Index: hsqldb_1_8_0
===================================================================
RCS file: /cvs/external/hsqldb/hsqldb_1_8_0,v
retrieving revision 1.15.2.1
diff -u -u -r1.15.2.1 hsqldb_1_8_0
--- hsqldb/hsqldb_1_8_0	30 Oct 2007 14:08:25 -0000	1.15.2.1
+++ hsqldb/hsqldb_1_8_0	3 Nov 2007 23:38:09 -0000
@@ -24,3 +24,23056 @@
      <property name="hsqldb.title" value="HSQLDB"/>
      <property name="hsqldb.vendor" value="The HSQLDB Development Group"/>
      <property name="src" value="${basedir}/src"/>
++diff -crN hsqldb-old/src/org/hsqldb/BaseMemoryNode.java hsqldb/src/org/hsqldb/BaseMemoryNode.java
++*** hsqldb-old/src/org/hsqldb/BaseMemoryNode.java	2006-06-15 13:20:26.000000000 +0200
++--- hsqldb/src/org/hsqldb/BaseMemoryNode.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 83,91 ****
++   */
++  abstract class BaseMemoryNode extends Node {
++  
++!     protected Node nLeft;
++!     protected Node nRight;
++!     protected Node nParent;
++  
++      void delete() {
++          iBalance = -2;
++--- 83,91 ----
++   */
++  abstract class BaseMemoryNode extends Node {
++  
++!     public Node nLeft;
++!     public Node nRight;
++!     public Node nParent;
++  
++      void delete() {
++          iBalance = -2;
++diff -crN hsqldb-old/src/org/hsqldb/CachedRow.java hsqldb/src/org/hsqldb/CachedRow.java
++*** hsqldb-old/src/org/hsqldb/CachedRow.java	2006-07-15 22:58:02.000000000 +0200
++--- hsqldb/src/org/hsqldb/CachedRow.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 99,111 ****
++      static final int NO_POS = -1;
++  
++      //
++!     protected Table tTable;
++      int             storageSize;
++  
++      /**
++       *  Flag indicating unwritten data.
++       */
++!     protected boolean hasDataChanged;
++  
++      /**
++       *  Flag indicating Node data has changed.
++--- 99,111 ----
++      static final int NO_POS = -1;
++  
++      //
++!     public Table tTable;
++      int             storageSize;
++  
++      /**
++       *  Flag indicating unwritten data.
++       */
++!     public boolean hasDataChanged;
++  
++      /**
++       *  Flag indicating Node data has changed.
++***************
++*** 183,189 ****
++          oData = in.readData(tTable.getColumnTypes());
++      }
++  
++!     private void readRowInfo(RowInputInterface in)
++      throws IOException, HsqlException {
++  
++          // for use when additional transaction info is attached to rows
++--- 183,189 ----
++          oData = in.readData(tTable.getColumnTypes());
++      }
++  
++!     public void readRowInfo(RowInputInterface in)
++      throws IOException, HsqlException {
++  
++          // for use when additional transaction info is attached to rows
++***************
++*** 323,329 ****
++          } catch (IOException e) {}
++      }
++  
++!     private void writeRowInfo(RowOutputInterface out) {
++  
++          // for use when additional transaction info is attached to rows
++      }
++--- 323,329 ----
++          } catch (IOException e) {}
++      }
++  
++!     public void writeRowInfo(RowOutputInterface out) {
++  
++          // for use when additional transaction info is attached to rows
++      }
++***************
++*** 352,358 ****
++       * @throws IOException
++       * @throws HsqlException
++       */
++!     private void writeNodes(RowOutputInterface out) throws IOException {
++  
++          out.writeSize(storageSize);
++  
++--- 352,358 ----
++       * @throws IOException
++       * @throws HsqlException
++       */
++!     public void writeNodes(RowOutputInterface out) throws IOException {
++  
++          out.writeSize(storageSize);
++  
++diff -crN hsqldb-old/src/org/hsqldb/Column.java hsqldb/src/org/hsqldb/Column.java
++*** hsqldb-old/src/org/hsqldb/Column.java	2006-07-21 15:39:54.000000000 +0200
++--- hsqldb/src/org/hsqldb/Column.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 126,138 ****
++      // most variables are final but not declared so because of a bug in
++      // JDK 1.1.8 compiler
++      public HsqlName         columnName;
++!     private int             colType;
++!     private int             colSize;
++!     private int             colScale;
++!     private boolean         isNullable;
++!     private boolean         isIdentity;
++!     private boolean         isPrimaryKey;
++!     private Expression      defaultExpression;
++      long                    identityStart;
++      long                    identityIncrement;
++      static final BigInteger MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
++--- 126,138 ----
++      // most variables are final but not declared so because of a bug in
++      // JDK 1.1.8 compiler
++      public HsqlName         columnName;
++!     public int             colType;
++!     public int             colSize;
++!     public int             colScale;
++!     public boolean         isNullable;
++!     public boolean         isIdentity;
++!     public boolean         isPrimaryKey;
++!     public Expression      defaultExpression;
++      long                    identityStart;
++      long                    identityIncrement;
++      static final BigInteger MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
++***************
++*** 187,193 ****
++          }
++      }
++  
++!     private Column() {}
++  
++      /**
++       * Used for primary key changes.
++--- 187,193 ----
++          }
++      }
++  
++!     public Column() {}
++  
++      /**
++       * Used for primary key changes.
++***************
++*** 1207,1213 ****
++       * @return
++       * @throws  HsqlException
++       */
++!     private static Object convertString(String s,
++                                          int type) throws HsqlException {
++  
++          switch (type) {
++--- 1207,1213 ----
++       * @return
++       * @throws  HsqlException
++       */
++!     public static Object convertString(String s,
++                                          int type) throws HsqlException {
++  
++          switch (type) {
++diff -crN hsqldb-old/src/org/hsqldb/CompiledStatementExecutor.java hsqldb/src/org/hsqldb/CompiledStatementExecutor.java
++*** hsqldb-old/src/org/hsqldb/CompiledStatementExecutor.java	2006-01-08 21:14:14.000000000 +0100
++--- hsqldb/src/org/hsqldb/CompiledStatementExecutor.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 54,64 ****
++   */
++  final class CompiledStatementExecutor {
++  
++!     private Session session;
++!     private Result  updateResult;
++!     private static Result emptyZeroResult =
++          new Result(ResultConstants.UPDATECOUNT);
++!     private static Result updateOneResult =
++          new Result(ResultConstants.UPDATECOUNT);
++  
++      static {
++--- 54,64 ----
++   */
++  final class CompiledStatementExecutor {
++  
++!     public Session session;
++!     public Result  updateResult;
++!     public static Result emptyZeroResult =
++          new Result(ResultConstants.UPDATECOUNT);
++!     public static Result updateOneResult =
++          new Result(ResultConstants.UPDATECOUNT);
++  
++      static {
++***************
++*** 120,126 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeImpl(CompiledStatement cs) throws HsqlException {
++  
++          switch (cs.type) {
++  
++--- 120,126 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeImpl(CompiledStatement cs) throws HsqlException {
++  
++          switch (cs.type) {
++  
++***************
++*** 160,166 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeCallStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Expression e = cs.expression;          // representing CALL
++--- 160,166 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeCallStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Expression e = cs.expression;          // representing CALL
++***************
++*** 197,203 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeDeleteStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table       table  = cs.targetTable;
++--- 197,203 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeDeleteStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table       table  = cs.targetTable;
++***************
++*** 232,238 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeInsertSelectStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table     t   = cs.targetTable;
++--- 232,238 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeInsertSelectStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table     t   = cs.targetTable;
++***************
++*** 286,292 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeInsertValuesStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table        t    = cs.targetTable;
++--- 286,292 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeInsertValuesStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table        t    = cs.targetTable;
++***************
++*** 317,323 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeSelectStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Select select = cs.select;
++--- 317,323 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeSelectStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Select select = cs.select;
++***************
++*** 358,364 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeUpdateStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table       table  = cs.targetTable;
++--- 358,364 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeUpdateStatement(CompiledStatement cs)
++      throws HsqlException {
++  
++          Table       table  = cs.targetTable;
++***************
++*** 420,426 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     private Result executeDDLStatement(CompiledStatement cs)
++      throws HsqlException {
++          return session.sqlExecuteDirectNoPreChecks(cs.sql);
++      }
++--- 420,426 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the result of executing the statement
++       */
++!     public Result executeDDLStatement(CompiledStatement cs)
++      throws HsqlException {
++          return session.sqlExecuteDirectNoPreChecks(cs.sql);
++      }
++diff -crN hsqldb-old/src/org/hsqldb/CompiledStatement.java hsqldb/src/org/hsqldb/CompiledStatement.java
++*** hsqldb-old/src/org/hsqldb/CompiledStatement.java	2006-09-22 15:14:00.000000000 +0200
++--- hsqldb/src/org/hsqldb/CompiledStatement.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 359,365 ****
++      /**
++       * For parameters in INSERT_VALUES and INSERT_SELECT lists
++       */
++!     private void resolveInsertParameterTypes() {
++  
++          for (int i = 0; i < select.iResultLen; i++) {
++              Expression colexpr = select.exprColumns[i];
++--- 359,365 ----
++      /**
++       * For parameters in INSERT_VALUES and INSERT_SELECT lists
++       */
++!     public void resolveInsertParameterTypes() {
++  
++          for (int i = 0; i < select.iResultLen; i++) {
++              Expression colexpr = select.exprColumns[i];
++***************
++*** 372,378 ****
++          }
++      }
++  
++!     private void setParameters(Expression[] params) {
++  
++          this.parameters = params;
++  
++--- 372,378 ----
++          }
++      }
++  
++!     public void setParameters(Expression[] params) {
++  
++          this.parameters = params;
++  
++***************
++*** 385,391 ****
++          this.paramTypes = types;
++      }
++  
++!     private void setSubqueries(SubQuery[] subqueries) {
++          this.subqueries = subqueries;
++      }
++  
++--- 385,391 ----
++          this.paramTypes = types;
++      }
++  
++!     public void setSubqueries(SubQuery[] subqueries) {
++          this.subqueries = subqueries;
++      }
++  
++***************
++*** 485,491 ****
++          table.checkDataReadOnly();
++      }
++  
++!     private static final Result updateCountResult =
++          new Result(ResultConstants.UPDATECOUNT);
++  
++      Result describeResult() {
++--- 485,491 ----
++          table.checkDataReadOnly();
++      }
++  
++!     public static final Result updateCountResult =
++          new Result(ResultConstants.UPDATECOUNT);
++  
++      Result describeResult() {
++***************
++*** 617,623 ****
++       * @throws Exception if a database access or io error occurs
++       * @return the String representation of this object
++       */
++!     private String describeImpl(Session session) throws Exception {
++  
++          StringBuffer sb;
++  
++--- 617,623 ----
++       * @throws Exception if a database access or io error occurs
++       * @return the String representation of this object
++       */
++!     public String describeImpl(Session session) throws Exception {
++  
++          StringBuffer sb;
++  
++***************
++*** 691,697 ****
++          }
++      }
++  
++!     private StringBuffer appendSubqueries(StringBuffer sb) {
++  
++          sb.append("SUBQUERIES[");
++  
++--- 691,697 ----
++          }
++      }
++  
++!     public StringBuffer appendSubqueries(StringBuffer sb) {
++  
++          sb.append("SUBQUERIES[");
++  
++***************
++*** 713,726 ****
++          return sb;
++      }
++  
++!     private StringBuffer appendTable(StringBuffer sb) {
++  
++          sb.append("TABLE[").append(targetTable.getName().name).append(']');
++  
++          return sb;
++      }
++  
++!     private StringBuffer appendColumns(StringBuffer sb) {
++  
++          sb.append("COLUMNS=[");
++  
++--- 713,726 ----
++          return sb;
++      }
++  
++!     public StringBuffer appendTable(StringBuffer sb) {
++  
++          sb.append("TABLE[").append(targetTable.getName().name).append(']');
++  
++          return sb;
++      }
++  
++!     public StringBuffer appendColumns(StringBuffer sb) {
++  
++          sb.append("COLUMNS=[");
++  
++***************
++*** 736,742 ****
++          return sb;
++      }
++  
++!     private StringBuffer appendParms(StringBuffer sb) {
++  
++          sb.append("PARAMETERS=[");
++  
++--- 736,742 ----
++          return sb;
++      }
++  
++!     public StringBuffer appendParms(StringBuffer sb) {
++  
++          sb.append("PARAMETERS=[");
++  
++***************
++*** 750,756 ****
++          return sb;
++      }
++  
++!     private StringBuffer appendCondition(Session session, StringBuffer sb) {
++  
++          return condition == null ? sb.append("CONDITION[]\n")
++                                   : sb.append("CONDITION[").append(
++--- 750,756 ----
++          return sb;
++      }
++  
++!     public StringBuffer appendCondition(Session session, StringBuffer sb) {
++  
++          return condition == null ? sb.append("CONDITION[]\n")
++                                   : sb.append("CONDITION[").append(
++diff -crN hsqldb-old/src/org/hsqldb/CompiledStatementManager.java hsqldb/src/org/hsqldb/CompiledStatementManager.java
++*** hsqldb-old/src/org/hsqldb/CompiledStatementManager.java	2006-04-11 17:13:22.000000000 +0200
++--- hsqldb/src/org/hsqldb/CompiledStatementManager.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 80,107 ****
++       * The Database for which this object is managing
++       * CompiledStatement objects.
++       */
++!     private Database database;
++  
++      /** Map: Schema id (int) => {Map: SQL String => Compiled Statement id (int)} */
++!     private IntKeyHashMap schemaMap;
++  
++      /** Map: Compiled Statement id (int) => SQL String */
++!     private IntKeyHashMap sqlLookup;
++  
++      /** Map: Compiled statment id (int) => CompiledStatement object. */
++!     private IntKeyHashMap csidMap;
++  
++      /** Map: Session id (int) => {Map: compiled statement id (int) => use count in session} */
++!     private IntKeyHashMap sessionUseMap;
++  
++      /** Map: Compiled statment id (int) => number of sessions that use the statement */
++!     private IntKeyIntValueHashMap useMap;
++  
++      /**
++       * Monotonically increasing counter used to assign unique ids to compiled
++       * statements.
++       */
++!     private int next_cs_id;
++  
++      /**
++       * Constructs a new instance of <code>CompiledStatementManager</code>.
++--- 80,107 ----
++       * The Database for which this object is managing
++       * CompiledStatement objects.
++       */
++!     public Database database;
++  
++      /** Map: Schema id (int) => {Map: SQL String => Compiled Statement id (int)} */
++!     public IntKeyHashMap schemaMap;
++  
++      /** Map: Compiled Statement id (int) => SQL String */
++!     public IntKeyHashMap sqlLookup;
++  
++      /** Map: Compiled statment id (int) => CompiledStatement object. */
++!     public IntKeyHashMap csidMap;
++  
++      /** Map: Session id (int) => {Map: compiled statement id (int) => use count in session} */
++!     public IntKeyHashMap sessionUseMap;
++  
++      /** Map: Compiled statment id (int) => number of sessions that use the statement */
++!     public IntKeyIntValueHashMap useMap;
++  
++      /**
++       * Monotonically increasing counter used to assign unique ids to compiled
++       * statements.
++       */
++!     public int next_cs_id;
++  
++      /**
++       * Constructs a new instance of <code>CompiledStatementManager</code>.
++***************
++*** 155,161 ****
++       *
++       * @return the next compiled statement identifier in the sequence.
++       */
++!     private int nextID() {
++  
++          next_cs_id++;
++  
++--- 155,161 ----
++       *
++       * @return the next compiled statement identifier in the sequence.
++       */
++!     public int nextID() {
++  
++          next_cs_id++;
++  
++***************
++*** 172,178 ****
++       * @return the compiled statement identifier associated with the
++       *      specified SQL String
++       */
++!     private int getStatementID(HsqlName schema, String sql) {
++  
++          IntValueHashMap sqlMap =
++              (IntValueHashMap) schemaMap.get(schema.hashCode());
++--- 172,178 ----
++       * @return the compiled statement identifier associated with the
++       *      specified SQL String
++       */
++!     public int getStatementID(HsqlName schema, String sql) {
++  
++          IntValueHashMap sqlMap =
++              (IntValueHashMap) schemaMap.get(schema.hashCode());
++***************
++*** 229,235 ****
++       * @param csid the compiled statement identifier
++       * @param sid the session identifier
++       */
++!     private void linkSession(int csid, int sid) {
++  
++          IntKeyIntValueHashMap scsMap;
++  
++--- 229,235 ----
++       * @param csid the compiled statement identifier
++       * @param sid the session identifier
++       */
++!     public void linkSession(int csid, int sid) {
++  
++          IntKeyIntValueHashMap scsMap;
++  
++***************
++*** 262,268 ****
++       * @return The compiled statement id assigned to the CompiledStatement
++       *  object
++       */
++!     private int registerStatement(int csid, CompiledStatement cs) {
++  
++          if (csid < 0) {
++              csid = nextID();
++--- 262,268 ----
++       * @return The compiled statement id assigned to the CompiledStatement
++       *  object
++       */
++!     public int registerStatement(int csid, CompiledStatement cs) {
++  
++          if (csid < 0) {
++              csid = nextID();
++***************
++*** 438,444 ****
++          return cs;
++      }
++  
++!     private CompiledStatement compileSql(Session session, String sql,
++                                           String schemaName) throws Throwable {
++  
++          Session sys = database.sessionManager.getSysSession(schemaName,
++--- 438,444 ----
++          return cs;
++      }
++  
++!     public CompiledStatement compileSql(Session session, String sql,
++                                           String schemaName) throws Throwable {
++  
++          Session sys = database.sessionManager.getSysSession(schemaName,
++diff -crN hsqldb-old/src/org/hsqldb/Constraint.java hsqldb/src/org/hsqldb/Constraint.java
++*** hsqldb-old/src/org/hsqldb/Constraint.java	2006-08-06 00:19:32.000000000 +0200
++--- hsqldb/src/org/hsqldb/Constraint.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 194,200 ****
++          core.updateAction = updateAction;
++      }
++  
++!     private Constraint() {}
++  
++      /**
++       * Returns the HsqlName.
++--- 194,200 ----
++          core.updateAction = updateAction;
++      }
++  
++!     public Constraint() {}
++  
++      /**
++       * Returns the HsqlName.
++***************
++*** 206,212 ****
++      /**
++       * Changes constraint name.
++       */
++!     private void setName(String name, boolean isquoted) throws HsqlException {
++          constName.rename(name, isquoted);
++      }
++  
++--- 206,212 ----
++      /**
++       * Changes constraint name.
++       */
++!     public void setName(String name, boolean isquoted) throws HsqlException {
++          constName.rename(name, isquoted);
++      }
++  
++***************
++*** 575,581 ****
++       * table. Also returns true if any column covered by the foreign key
++       * constraint has a null value.
++       */
++!     private static boolean hasReferencedRow(Session session,
++              Object[] rowdata, int[] rowColArray,
++              Index mainIndex) throws HsqlException {
++  
++--- 575,581 ----
++       * table. Also returns true if any column covered by the foreign key
++       * constraint has a null value.
++       */
++!     public static boolean hasReferencedRow(Session session,
++              Object[] rowdata, int[] rowColArray,
++              Index mainIndex) throws HsqlException {
++  
++diff -crN hsqldb-old/src/org/hsqldb/DatabaseCommandInterpreter.java hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java
++*** hsqldb-old/src/org/hsqldb/DatabaseCommandInterpreter.java	2007-07-23 20:30:46.000000000 +0200
++--- hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 111,119 ****
++  // fredt@users 20041209 - patch by tytar@users to set default table type
++  class DatabaseCommandInterpreter {
++  
++!     private Tokenizer tokenizer = new Tokenizer();
++!     private Database  database;
++!     private Session   session;
++  
++      /**
++       * Constructs a new DatabaseCommandInterpreter for the given Session
++--- 111,119 ----
++  // fredt@users 20041209 - patch by tytar@users to set default table type
++  class DatabaseCommandInterpreter {
++  
++!     public Tokenizer tokenizer = new Tokenizer();
++!     public Database  database;
++!     public Session   session;
++  
++      /**
++       * Constructs a new DatabaseCommandInterpreter for the given Session
++***************
++*** 201,207 ****
++                                : result;
++      }
++  
++!     private Result executePart(int cmd, String token) throws Throwable {
++  
++          Result result   = Session.emptyUpdateCount;
++          int    brackets = 0;
++--- 201,207 ----
++                                : result;
++      }
++  
++!     public Result executePart(int cmd, String token) throws Throwable {
++  
++          Result result   = Session.emptyUpdateCount;
++          int    brackets = 0;
++***************
++*** 389,395 ****
++       * @throws IOException
++       * @throws HsqlException
++       */
++!     private Result processScript() throws IOException, HsqlException {
++  
++          String           token = tokenizer.getString();
++          ScriptWriterText dsw   = null;
++--- 389,395 ----
++       * @throws IOException
++       * @throws HsqlException
++       */
++!     public Result processScript() throws IOException, HsqlException {
++  
++          String           token = tokenizer.getString();
++          ScriptWriterText dsw   = null;
++***************
++*** 430,436 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processCreate() throws HsqlException {
++  
++          boolean unique = false;
++          int     tableType;
++--- 430,436 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processCreate() throws HsqlException {
++  
++          boolean unique = false;
++          int     tableType;
++***************
++*** 550,556 ****
++       * @return  column index map
++       * @throws  HsqlException if a column is not found or is duplicate
++       */
++!     private int[] processColumnList(Table t,
++                                      boolean acceptAscDesc)
++                                      throws HsqlException {
++  
++--- 550,556 ----
++       * @return  column index map
++       * @throws  HsqlException if a column is not found or is duplicate
++       */
++!     public int[] processColumnList(Table t,
++                                      boolean acceptAscDesc)
++                                      throws HsqlException {
++  
++***************
++*** 574,580 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processCreateTrigger() throws HsqlException {
++  
++          Table      t;
++          boolean    isForEach;
++--- 574,580 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processCreateTrigger() throws HsqlException {
++  
++          Table      t;
++          boolean    isForEach;
++***************
++*** 694,700 ****
++  // --
++      }
++  
++!     private Column processCreateColumn() throws HsqlException {
++  
++          String   token    = tokenizer.getSimpleName();
++          boolean  isQuoted = tokenizer.wasQuotedIdentifier();
++--- 694,700 ----
++  // --
++      }
++  
++!     public Column processCreateColumn() throws HsqlException {
++  
++          String   token    = tokenizer.getSimpleName();
++          boolean  isQuoted = tokenizer.wasQuotedIdentifier();
++***************
++*** 711,717 ****
++       *  @return a Column object with indicated attributes
++       *  @throws  HsqlException
++       */
++!     private Column processCreateColumn(HsqlName hsqlName)
++      throws HsqlException {
++  
++          boolean    isIdentity        = false;
++--- 711,717 ----
++       *  @return a Column object with indicated attributes
++       *  @throws  HsqlException
++       */
++!     public Column processCreateColumn(HsqlName hsqlName)
++      throws HsqlException {
++  
++          boolean    isIdentity        = false;
++***************
++*** 882,888 ****
++       * @throws HsqlException
++       * @return new Expression
++       */
++!     private Expression processCreateDefaultExpression(int type, int length,
++              int scale) throws HsqlException {
++  
++          if (type == Types.OTHER) {
++--- 882,888 ----
++       * @throws HsqlException
++       * @return new Expression
++       */
++!     public Expression processCreateDefaultExpression(int type, int length,
++              int scale) throws HsqlException {
++  
++          if (type == Types.OTHER) {
++***************
++*** 953,959 ****
++       * @throws HsqlException
++       * @return list of constraints
++       */
++!     private HsqlArrayList processCreateConstraints(Table t,
++              boolean constraint, int[] primarykeycolumn) throws HsqlException {
++  
++          String        token;
++--- 953,959 ----
++       * @throws HsqlException
++       * @return list of constraints
++       */
++!     public HsqlArrayList processCreateConstraints(Table t,
++              boolean constraint, int[] primarykeycolumn) throws HsqlException {
++  
++          String        token;
++***************
++*** 1109,1115 ****
++       * @param c check constraint
++       * @throws HsqlException
++       */
++!     private void processCreateCheckConstraintCondition(Constraint c)
++      throws HsqlException {
++  
++          tokenizer.getThis(Token.T_OPENBRACKET);
++--- 1109,1115 ----
++       * @param c check constraint
++       * @throws HsqlException
++       */
++!     public void processCreateCheckConstraintCondition(Constraint c)
++      throws HsqlException {
++  
++          tokenizer.getThis(Token.T_OPENBRACKET);
++***************
++*** 1128,1134 ****
++       * @param type Description of the Parameter
++       * @throws HsqlException
++       */
++!     private void processCreateTable(int type) throws HsqlException {
++  
++          String token = tokenizer.getName();
++          HsqlName schemaname =
++--- 1128,1134 ----
++       * @param type Description of the Parameter
++       * @throws HsqlException
++       */
++!     public void processCreateTable(int type) throws HsqlException {
++  
++          String token = tokenizer.getName();
++          HsqlName schemaname =
++***************
++*** 1296,1302 ****
++       * @throws HsqlException
++       * @return constraint
++       */
++!     private Constraint processCreateFK(Table t,
++                                         HsqlName cname) throws HsqlException {
++  
++          int[]  localcol;
++--- 1296,1302 ----
++       * @throws HsqlException
++       * @return constraint
++       */
++!     public Constraint processCreateFK(Table t,
++                                         HsqlName cname) throws HsqlException {
++  
++          int[]  localcol;
++***************
++*** 1438,1444 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processCreateView() throws HsqlException {
++  
++          String name = tokenizer.getName();
++          HsqlName schemaname =
++--- 1438,1444 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processCreateView() throws HsqlException {
++  
++          String name = tokenizer.getName();
++          HsqlName schemaname =
++***************
++*** 1518,1524 ****
++       * @param t table
++       * @throws HsqlException
++       */
++!     private void processAlterTableRename(Table t) throws HsqlException {
++  
++          String  schema = t.getSchemaName();
++          String  newName;
++--- 1518,1524 ----
++       * @param t table
++       * @throws HsqlException
++       */
++!     public void processAlterTableRename(Table t) throws HsqlException {
++  
++          String  schema = t.getSchemaName();
++          String  newName;
++***************
++*** 1565,1571 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processAlter() throws HsqlException {
++  
++          String token;
++  
++--- 1565,1571 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processAlter() throws HsqlException {
++  
++          String token;
++  
++***************
++*** 1613,1619 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processAlterTable() throws HsqlException {
++  
++          String tableName = tokenizer.getName();
++          String schema =
++--- 1613,1619 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processAlterTable() throws HsqlException {
++  
++          String tableName = tokenizer.getName();
++          String schema =
++***************
++*** 1774,1780 ****
++       * @param t table
++       * @throws HsqlException
++       */
++!     private void processAlterColumn(Table t) throws HsqlException {
++  
++          String columnName  = tokenizer.getSimpleName();
++          int    columnIndex = t.getColumnNr(columnName);
++--- 1774,1780 ----
++       * @param t table
++       * @throws HsqlException
++       */
++!     public void processAlterColumn(Table t) throws HsqlException {
++  
++          String columnName  = tokenizer.getSimpleName();
++          int    columnIndex = t.getColumnNr(columnName);
++***************
++*** 1851,1857 ****
++          }
++      }
++  
++!     private void processAlterColumnType(Table table,
++                                          Column oldCol) throws HsqlException {
++  
++          Column     newCol = processCreateColumn(oldCol.columnName);
++--- 1851,1857 ----
++          }
++      }
++  
++!     public void processAlterColumnType(Table table,
++                                          Column oldCol) throws HsqlException {
++  
++          Column     newCol = processCreateColumn(oldCol.columnName);
++***************
++*** 1866,1872 ****
++       * @param column column
++       * @throws HsqlException
++       */
++!     private void processAlterColumnRename(Table t,
++                                            Column column) throws HsqlException {
++  
++          String  newName  = tokenizer.getSimpleName();
++--- 1866,1872 ----
++       * @param column column
++       * @throws HsqlException
++       */
++!     public void processAlterColumnRename(Table t,
++                                            Column column) throws HsqlException {
++  
++          String  newName  = tokenizer.getSimpleName();
++***************
++*** 1888,1900 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processAlterIndex() throws HsqlException {
++  
++          // only the one supported operation, so far
++          processAlterIndexRename();
++      }
++  
++!     private void processAlterSchema() throws HsqlException {
++  
++          // only the one supported operation, so far
++          processAlterSchemaRename();
++--- 1888,1900 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processAlterIndex() throws HsqlException {
++  
++          // only the one supported operation, so far
++          processAlterIndexRename();
++      }
++  
++!     public void processAlterSchema() throws HsqlException {
++  
++          // only the one supported operation, so far
++          processAlterSchemaRename();
++***************
++*** 1905,1911 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processDrop() throws HsqlException {
++  
++          String  token;
++          boolean isview;
++--- 1905,1911 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processDrop() throws HsqlException {
++  
++          String  token;
++          boolean isview;
++***************
++*** 1971,1977 ****
++       * @param grant true if grant, false if revoke
++       * @throws HsqlException
++       */
++!     private void processGrantOrRevoke(boolean grant) throws HsqlException {
++  
++          int    right;
++          Object accessKey;
++--- 1971,1977 ----
++       * @param grant true if grant, false if revoke
++       * @throws HsqlException
++       */
++!     public void processGrantOrRevoke(boolean grant) throws HsqlException {
++  
++          int    right;
++          Object accessKey;
++***************
++*** 2038,2044 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processConnect() throws HsqlException {
++  
++          String userName;
++          String password;
++--- 2038,2044 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processConnect() throws HsqlException {
++  
++          String userName;
++          String password;
++***************
++*** 2074,2080 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processSet() throws HsqlException {
++  
++          String token;
++  
++--- 2074,2080 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processSet() throws HsqlException {
++  
++          String token;
++  
++***************
++*** 2393,2399 ****
++       * @return   true if next token is "TRUE"; false if next token is "FALSE"
++       * @throws  HsqlException if the next token is neither "TRUE" or "FALSE"
++       */
++!     private boolean processTrueOrFalse() throws HsqlException {
++  
++          String sToken = tokenizer.getSimpleToken();
++  
++--- 2393,2399 ----
++       * @return   true if next token is "TRUE"; false if next token is "FALSE"
++       * @throws  HsqlException if the next token is neither "TRUE" or "FALSE"
++       */
++!     public boolean processTrueOrFalse() throws HsqlException {
++  
++          String sToken = tokenizer.getSimpleToken();
++  
++***************
++*** 2411,2417 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processCommit() throws HsqlException {
++          tokenizer.isGetThis(Token.T_WORK);
++          session.commit();
++      }
++--- 2411,2417 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processCommit() throws HsqlException {
++          tokenizer.isGetThis(Token.T_WORK);
++          session.commit();
++      }
++***************
++*** 2421,2427 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processRollback() throws HsqlException {
++  
++          String  token;
++          boolean toSavepoint;
++--- 2421,2427 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processRollback() throws HsqlException {
++  
++          String  token;
++          boolean toSavepoint;
++***************
++*** 2453,2459 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processSavepoint() throws HsqlException {
++  
++          String token;
++  
++--- 2453,2459 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processSavepoint() throws HsqlException {
++  
++          String token;
++  
++***************
++*** 2467,2473 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processShutdown() throws HsqlException {
++  
++          int    closemode;
++          String token;
++--- 2467,2473 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processShutdown() throws HsqlException {
++  
++          int    closemode;
++          String token;
++***************
++*** 2502,2508 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void processCheckpoint() throws HsqlException {
++  
++          boolean defrag;
++          String  token;
++--- 2502,2508 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void processCheckpoint() throws HsqlException {
++  
++          boolean defrag;
++          String  token;
++***************
++*** 2526,2532 ****
++      }
++  
++  // --------------------- new methods / simplifications ------------------------
++!     private HsqlName newIndexHsqlName(String name,
++                                        boolean isQuoted) throws HsqlException {
++  
++          return HsqlName.isReservedName(name)
++--- 2526,2532 ----
++      }
++  
++  // --------------------- new methods / simplifications ------------------------
++!     public HsqlName newIndexHsqlName(String name,
++                                        boolean isQuoted) throws HsqlException {
++  
++          return HsqlName.isReservedName(name)
++***************
++*** 2534,2540 ****
++                 : database.nameManager.newHsqlName(name, isQuoted);
++      }
++  
++!     private Table newTable(int type, String name, boolean quoted,
++                             HsqlName schema) throws HsqlException {
++  
++          HsqlName tableHsqlName = database.nameManager.newHsqlName(name,
++--- 2534,2540 ----
++                 : database.nameManager.newHsqlName(name, isQuoted);
++      }
++  
++!     public Table newTable(int type, String name, boolean quoted,
++                             HsqlName schema) throws HsqlException {
++  
++          HsqlName tableHsqlName = database.nameManager.newHsqlName(name,
++***************
++*** 2563,2569 ****
++       * @throws HsqlException if the operation of adding the Column, c, to
++       *      the table t is not valid
++       */
++!     private void checkAddColumn(Table t, Column c) throws HsqlException {
++  
++          boolean canAdd = true;
++  
++--- 2563,2569 ----
++       * @throws HsqlException if the operation of adding the Column, c, to
++       *      the table t is not valid
++       */
++!     public void checkAddColumn(Table t, Column c) throws HsqlException {
++  
++          boolean canAdd = true;
++  
++***************
++*** 2584,2590 ****
++          }
++      }
++  
++!     private void checkFKColumnDefaults(Table t,
++                                         Constraint tc) throws HsqlException {
++  
++          boolean check = tc.core.updateAction == Constraint.SET_DEFAULT;
++--- 2584,2590 ----
++          }
++      }
++  
++!     public void checkFKColumnDefaults(Table t,
++                                         Constraint tc) throws HsqlException {
++  
++          boolean check = tc.core.updateAction == Constraint.SET_DEFAULT;
++***************
++*** 2608,2614 ****
++          }
++      }
++  
++!     private void processAlterSequence() throws HsqlException {
++  
++          long   start;
++          String name       = tokenizer.getName();
++--- 2608,2614 ----
++          }
++      }
++  
++!     public void processAlterSequence() throws HsqlException {
++  
++          long   start;
++          String name       = tokenizer.getName();
++***************
++*** 2632,2638 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processAlterIndexRename() throws HsqlException {
++  
++          String name = tokenizer.getName();
++          String schema =
++--- 2632,2638 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processAlterIndexRename() throws HsqlException {
++  
++          String name = tokenizer.getName();
++          String schema =
++***************
++*** 2682,2688 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processAlterSchemaRename() throws HsqlException {
++  
++          String name = tokenizer.getSimpleName();
++  
++--- 2682,2688 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processAlterSchemaRename() throws HsqlException {
++  
++          String name = tokenizer.getSimpleName();
++  
++***************
++*** 2700,2706 ****
++       * @param t table
++       * @throws HsqlException
++       */
++!     private void processAlterTableAddColumn(Table t) throws HsqlException {
++  
++          String token;
++          int    colindex = t.getColumnCount();
++--- 2700,2706 ----
++       * @param t table
++       * @throws HsqlException
++       */
++!     public void processAlterTableAddColumn(Table t) throws HsqlException {
++  
++          String token;
++          int    colindex = t.getColumnCount();
++***************
++*** 2728,2734 ****
++       * @param t table
++       * @throws HsqlException
++       */
++!     private void processAlterTableDropColumn(Table t) throws HsqlException {
++  
++          String token;
++          int    colindex;
++--- 2728,2734 ----
++       * @param t table
++       * @throws HsqlException
++       */
++!     public void processAlterTableDropColumn(Table t) throws HsqlException {
++  
++          String token;
++          int    colindex;
++***************
++*** 2749,2755 ****
++       * @param t table
++       * @throws HsqlException
++       */
++!     private void processAlterTableDropConstraint(Table t)
++      throws HsqlException {
++          processAlterTableDropConstraint(t, tokenizer.getName());
++      }
++--- 2749,2755 ----
++       * @param t table
++       * @throws HsqlException
++       */
++!     public void processAlterTableDropConstraint(Table t)
++      throws HsqlException {
++          processAlterTableDropConstraint(t, tokenizer.getName());
++      }
++***************
++*** 2761,2767 ****
++       * @param name
++       * @throws HsqlException
++       */
++!     private void processAlterTableDropConstraint(Table t,
++              String cname) throws HsqlException {
++  
++          session.commit();
++--- 2761,2767 ----
++       * @param name
++       * @throws HsqlException
++       */
++!     public void processAlterTableDropConstraint(Table t,
++              String cname) throws HsqlException {
++  
++          session.commit();
++***************
++*** 2777,2783 ****
++       * If an invalid alias is encountered while processing an old script,
++       * simply discard it.
++       */
++!     private void processCreateAlias() throws HsqlException {
++  
++          String alias;
++          String methodFQN;
++--- 2777,2783 ----
++       * If an invalid alias is encountered while processing an old script,
++       * simply discard it.
++       */
++!     public void processCreateAlias() throws HsqlException {
++  
++          String alias;
++          String methodFQN;
++***************
++*** 2801,2807 ****
++          }
++      }
++  
++!     private void processCreateIndex(boolean unique) throws HsqlException {
++  
++          Table   t;
++          String  indexName       = tokenizer.getName();
++--- 2801,2807 ----
++          }
++      }
++  
++!     public void processCreateIndex(boolean unique) throws HsqlException {
++  
++          Table   t;
++          String  indexName       = tokenizer.getName();
++***************
++*** 2845,2851 ****
++       * be positive
++       * @throws HsqlException
++       */
++!     private void processCreateSequence() throws HsqlException {
++  
++  /*
++          CREATE SEQUENCE <name>
++--- 2845,2851 ----
++       * be positive
++       * @throws HsqlException
++       */
++!     public void processCreateSequence() throws HsqlException {
++  
++  /*
++          CREATE SEQUENCE <name>
++***************
++*** 2894,2900 ****
++       * CREATE SCHEMA PUBLIC in scripts should pass this, so we do not throw
++       * if this schema is created a second time
++       */
++!     private void processCreateSchema() throws HsqlException {
++  
++          String  name     = tokenizer.getSimpleName();
++          boolean isquoted = tokenizer.wasQuotedIdentifier();
++--- 2894,2900 ----
++       * CREATE SCHEMA PUBLIC in scripts should pass this, so we do not throw
++       * if this schema is created a second time
++       */
++!     public void processCreateSchema() throws HsqlException {
++  
++          String  name     = tokenizer.getSimpleName();
++          boolean isquoted = tokenizer.wasQuotedIdentifier();
++***************
++*** 2926,2932 ****
++          session.loggedSchema = session.currentSchema;
++      }
++  
++!     private void processCreateUser() throws HsqlException {
++  
++          String  name;
++          String  password;
++--- 2926,2932 ----
++          session.loggedSchema = session.currentSchema;
++      }
++  
++!     public void processCreateUser() throws HsqlException {
++  
++          String  name;
++          String  password;
++***************
++*** 2947,2957 ****
++          }
++      }
++  
++!     private void processDisconnect() throws HsqlException {
++          session.close();
++      }
++  
++!     private void processDropTable(boolean isView) throws HsqlException {
++  
++          boolean ifexists = false;
++          boolean cascade  = false;
++--- 2947,2957 ----
++          }
++      }
++  
++!     public void processDisconnect() throws HsqlException {
++          session.close();
++      }
++  
++!     public void processDropTable(boolean isView) throws HsqlException {
++  
++          boolean ifexists = false;
++          boolean cascade  = false;
++***************
++*** 2988,2994 ****
++                                           isView, cascade);
++      }
++  
++!     private void processDropUser() throws HsqlException {
++  
++          session.checkAdmin();
++          session.checkDDLWrite();
++--- 2988,2994 ----
++                                           isView, cascade);
++      }
++  
++!     public void processDropUser() throws HsqlException {
++  
++          session.checkAdmin();
++          session.checkDDLWrite();
++***************
++*** 3004,3010 ****
++          database.getUserManager().dropUser(userName);
++      }
++  
++!     private void processDropSequence() throws HsqlException {
++  
++          boolean ifexists = false;
++  
++--- 3004,3010 ----
++          database.getUserManager().dropUser(userName);
++      }
++  
++!     public void processDropSequence() throws HsqlException {
++  
++          boolean ifexists = false;
++  
++***************
++*** 3042,3048 ****
++          database.schemaManager.dropSequence(sequence);
++      }
++  
++!     private void processDropTrigger() throws HsqlException {
++  
++          session.checkAdmin();
++          session.checkDDLWrite();
++--- 3042,3048 ----
++          database.schemaManager.dropSequence(sequence);
++      }
++  
++!     public void processDropTrigger() throws HsqlException {
++  
++          session.checkAdmin();
++          session.checkDDLWrite();
++***************
++*** 3054,3060 ****
++          database.schemaManager.dropTrigger(session, triggername, schemaname);
++      }
++  
++!     private void processDropIndex() throws HsqlException {
++  
++          String name = tokenizer.getName();
++          String schema =
++--- 3054,3060 ----
++          database.schemaManager.dropTrigger(session, triggername, schemaname);
++      }
++  
++!     public void processDropIndex() throws HsqlException {
++  
++          String name = tokenizer.getName();
++          String schema =
++***************
++*** 3077,3083 ****
++          database.schemaManager.dropIndex(session, name, schema, ifexists);
++      }
++  
++!     private void processDropSchema() throws HsqlException {
++  
++          String  name    = tokenizer.getSimpleName();
++          boolean cascade = tokenizer.isGetThis(Token.T_CASCADE);
++--- 3077,3083 ----
++          database.schemaManager.dropIndex(session, name, schema, ifexists);
++      }
++  
++!     public void processDropSchema() throws HsqlException {
++  
++          String  name    = tokenizer.getSimpleName();
++          boolean cascade = tokenizer.isGetThis(Token.T_CASCADE);
++***************
++*** 3089,3095 ****
++          processDropSchema(name, cascade);
++      }
++  
++!     private void processDropSchema(String name,
++                                     boolean cascade) throws HsqlException {
++  
++          if (!database.schemaManager.schemaExists(name)) {
++--- 3089,3095 ----
++          processDropSchema(name, cascade);
++      }
++  
++!     public void processDropSchema(String name,
++                                     boolean cascade) throws HsqlException {
++  
++          if (!database.schemaManager.schemaExists(name)) {
++***************
++*** 3103,3109 ****
++          }
++      }
++  
++!     private Result processExplainPlan() throws IOException, HsqlException {
++  
++          // PRE:  we assume only one DML or DQL has been submitted
++          //       and simply ignore anything following the first
++--- 3103,3109 ----
++          }
++      }
++  
++!     public Result processExplainPlan() throws IOException, HsqlException {
++  
++          // PRE:  we assume only one DML or DQL has been submitted
++          //       and simply ignore anything following the first
++***************
++*** 3175,3181 ****
++      static final int    oldLibLen = oldLib.length();
++      static final String newLib    = "org.hsqldb.Library.";
++  
++!     private static String upgradeMethodFQN(String fqn) {
++  
++          if (fqn.startsWith(oldLib)) {
++              fqn = newLib + fqn.substring(oldLibLen);
++--- 3175,3181 ----
++      static final int    oldLibLen = oldLib.length();
++      static final String newLib    = "org.hsqldb.Library.";
++  
++!     public static String upgradeMethodFQN(String fqn) {
++  
++          if (fqn.startsWith(oldLib)) {
++              fqn = newLib + fqn.substring(oldLibLen);
++***************
++*** 3252,3258 ****
++       * @param t table
++       * @throws  HsqlException
++       */
++!     private void logTableDDL(Table t) throws HsqlException {
++  
++          StringBuffer tableDDL;
++          String       sourceDDL;
++--- 3252,3258 ----
++       * @param t table
++       * @throws  HsqlException
++       */
++!     public void logTableDDL(Table t) throws HsqlException {
++  
++          StringBuffer tableDDL;
++          String       sourceDDL;
++***************
++*** 3270,3276 ****
++          }
++      }
++  
++!     private void processAlterTableAddUniqueConstraint(Table t,
++              HsqlName n) throws HsqlException {
++  
++          int[] col;
++--- 3270,3276 ----
++          }
++      }
++  
++!     public void processAlterTableAddUniqueConstraint(Table t,
++              HsqlName n) throws HsqlException {
++  
++          int[] col;
++***************
++*** 3288,3294 ****
++          tableWorks.createUniqueConstraint(col, n);
++      }
++  
++!     private void processAlterTableAddForeignKeyConstraint(Table t,
++              HsqlName n) throws HsqlException {
++  
++          Constraint tc;
++--- 3288,3294 ----
++          tableWorks.createUniqueConstraint(col, n);
++      }
++  
++!     public void processAlterTableAddForeignKeyConstraint(Table t,
++              HsqlName n) throws HsqlException {
++  
++          Constraint tc;
++***************
++*** 3312,3318 ****
++                                      tc.core.updateAction);
++      }
++  
++!     private void processAlterTableAddCheckConstraint(Table table,
++              HsqlName name) throws HsqlException {
++  
++          Constraint check;
++--- 3312,3318 ----
++                                      tc.core.updateAction);
++      }
++  
++!     public void processAlterTableAddCheckConstraint(Table table,
++              HsqlName name) throws HsqlException {
++  
++          Constraint check;
++***************
++*** 3332,3338 ****
++          tableWorks.createCheckConstraint(check, name);
++      }
++  
++!     private void processAlterTableAddPrimaryKey(Table t,
++              HsqlName n) throws HsqlException {
++  
++          int[] col;
++--- 3332,3338 ----
++          tableWorks.createCheckConstraint(check, name);
++      }
++  
++!     public void processAlterTableAddPrimaryKey(Table t,
++              HsqlName n) throws HsqlException {
++  
++          int[] col;
++***************
++*** 3346,3352 ****
++          tableWorks.addPrimaryKey(col, n);
++      }
++  
++!     private void processReleaseSavepoint() throws HsqlException {
++  
++          String token;
++  
++--- 3346,3352 ----
++          tableWorks.addPrimaryKey(col, n);
++      }
++  
++!     public void processReleaseSavepoint() throws HsqlException {
++  
++          String token;
++  
++***************
++*** 3357,3363 ****
++          session.releaseSavepoint(token);
++      }
++  
++!     private void processAlterUser() throws HsqlException {
++  
++          String userName;
++          String password;
++--- 3357,3363 ----
++          session.releaseSavepoint(token);
++      }
++  
++!     public void processAlterUser() throws HsqlException {
++  
++          String userName;
++          String password;
++***************
++*** 3377,3383 ****
++          session.setScripting(false);
++      }
++  
++!     private String getUserIdentifier() throws HsqlException {
++  
++          String    token = tokenizer.getString();
++          Tokenizer t     = new Tokenizer(token);
++--- 3377,3383 ----
++          session.setScripting(false);
++      }
++  
++!     public String getUserIdentifier() throws HsqlException {
++  
++          String    token = tokenizer.getString();
++          Tokenizer t     = new Tokenizer(token);
++***************
++*** 3385,3391 ****
++          return t.getSimpleName();
++      }
++  
++!     private String getPassword() throws HsqlException {
++  
++          String token = tokenizer.getString();
++  
++--- 3385,3391 ----
++          return t.getSimpleName();
++      }
++  
++!     public String getPassword() throws HsqlException {
++  
++          String token = tokenizer.getString();
++  
++***************
++*** 3398,3404 ****
++       *
++       * @throws HsqlException
++       */
++!     private void processRoleGrantOrRevoke(boolean grant) throws HsqlException {
++  
++          String         token;
++          HsqlArrayList  list = new HsqlArrayList();
++--- 3398,3404 ----
++       *
++       * @throws HsqlException
++       */
++!     public void processRoleGrantOrRevoke(boolean grant) throws HsqlException {
++  
++          String         token;
++          HsqlArrayList  list = new HsqlArrayList();
++diff -crN hsqldb-old/src/org/hsqldb/DatabaseInformationFull.java hsqldb/src/org/hsqldb/DatabaseInformationFull.java
++*** hsqldb-old/src/org/hsqldb/DatabaseInformationFull.java	2007-10-11 11:32:16.000000000 +0200
++--- hsqldb/src/org/hsqldb/DatabaseInformationFull.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 64,70 ****
++  extends org.hsqldb.DatabaseInformationMain {
++  
++      /** Provides SQL function/procedure reporting support. */
++!     protected DIProcedureInfo pi;
++  
++      /**
++       * Constructs a new DatabaseInformationFull instance. <p>
++--- 64,70 ----
++  extends org.hsqldb.DatabaseInformationMain {
++  
++      /** Provides SQL function/procedure reporting support. */
++!     public DIProcedureInfo pi;
++  
++      /**
++       * Constructs a new DatabaseInformationFull instance. <p>
++***************
++*** 86,92 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the system table corresponding to the specified index
++       */
++!     protected Table generateTable(int tableIndex) throws HsqlException {
++  
++          switch (tableIndex) {
++  
++--- 86,92 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the system table corresponding to the specified index
++       */
++!     public Table generateTable(int tableIndex) throws HsqlException {
++  
++          switch (tableIndex) {
++  
++***************
++*** 3186,3192 ****
++       *      in the table
++       *
++       */
++!     protected void addPColRows(Table t, HsqlArrayList l, String cat,
++                                 String schem, String pName, String cName,
++                                 Integer cType, Integer dType, String tName,
++                                 Integer prec, Integer len, Integer scale,
++--- 3186,3192 ----
++       *      in the table
++       *
++       */
++!     public void addPColRows(Table t, HsqlArrayList l, String cat,
++                                 String schem, String pName, String cName,
++                                 Integer cType, Integer dType, String tName,
++                                 Integer prec, Integer len, Integer scale,
++***************
++*** 3286,3292 ****
++       *      in the table
++       *
++       */
++!     protected void addProcRows(Table t, HsqlArrayList l, String cat,
++                                 String schem, String pName, Integer ip,
++                                 Integer op, Integer rs, String remark,
++                                 Integer pType, String origin,
++--- 3286,3292 ----
++       *      in the table
++       *
++       */
++!     public void addProcRows(Table t, HsqlArrayList l, String cat,
++                                 String schem, String pName, Integer ip,
++                                 Integer op, Integer rs, String remark,
++                                 Integer pType, String origin,
++diff -crN hsqldb-old/src/org/hsqldb/DatabaseInformation.java hsqldb/src/org/hsqldb/DatabaseInformation.java
++*** hsqldb-old/src/org/hsqldb/DatabaseInformation.java	2007-01-09 16:31:02.000000000 +0100
++--- hsqldb/src/org/hsqldb/DatabaseInformation.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 56,124 ****
++  class DatabaseInformation {
++  
++      // ids for system table names strictly in order of sysTableNames[]
++!     protected static final int SYSTEM_BESTROWIDENTIFIER = 0;
++!     protected static final int SYSTEM_CATALOGS          = 1;
++!     protected static final int SYSTEM_COLUMNPRIVILEGES  = 2;
++!     protected static final int SYSTEM_COLUMNS           = 3;
++!     protected static final int SYSTEM_CROSSREFERENCE    = 4;
++!     protected static final int SYSTEM_INDEXINFO         = 5;
++!     protected static final int SYSTEM_PRIMARYKEYS       = 6;
++!     protected static final int SYSTEM_PROCEDURECOLUMNS  = 7;
++!     protected static final int SYSTEM_PROCEDURES        = 8;
++!     protected static final int SYSTEM_SCHEMAS           = 9;
++!     protected static final int SYSTEM_SUPERTABLES       = 10;
++!     protected static final int SYSTEM_SUPERTYPES        = 11;
++!     protected static final int SYSTEM_TABLEPRIVILEGES   = 12;
++!     protected static final int SYSTEM_TABLES            = 13;
++!     protected static final int SYSTEM_TABLETYPES        = 14;
++!     protected static final int SYSTEM_TYPEINFO          = 15;
++!     protected static final int SYSTEM_UDTATTRIBUTES     = 16;
++!     protected static final int SYSTEM_UDTS              = 17;
++!     protected static final int SYSTEM_USERS             = 18;
++!     protected static final int SYSTEM_VERSIONCOLUMNS    = 19;
++  
++      // HSQLDB-specific
++!     protected static final int SYSTEM_ALIASES         = 20;
++!     protected static final int SYSTEM_BYTECODE        = 21;
++!     protected static final int SYSTEM_CACHEINFO       = 22;
++!     protected static final int SYSTEM_CLASSPRIVILEGES = 23;
++!     protected static final int SYSTEM_SESSIONINFO     = 24;
++!     protected static final int SYSTEM_PROPERTIES      = 25;
++!     protected static final int SYSTEM_SESSIONS        = 26;
++!     protected static final int SYSTEM_TRIGGERCOLUMNS  = 27;
++!     protected static final int SYSTEM_TRIGGERS        = 28;
++!     protected static final int SYSTEM_ALLTYPEINFO     = 29;
++  
++  // boucherb@users 20030305 - brought in line with SQL 200n
++!     protected static final int SYSTEM_VIEWS = 30;
++  
++  // boucherb@users 20030403 - isolated and improved text table reporting
++!     protected static final int SYSTEM_TEXTTABLES = 31;
++  
++  // boucherb@users 20040107 - metadata support for sequences
++!     protected static final int SYSTEM_SEQUENCES        = 32;
++!     protected static final int SYSTEM_USAGE_PRIVILEGES = 33;
++  
++  // boucherb@users 20040107 - metadata support for constraints
++!     protected static final int SYSTEM_CHECK_CONSTRAINTS = 34;
++!     protected static final int SYSTEM_TABLE_CONSTRAINTS = 35;
++  
++  // boucherb@users 20040107 - metadata support for view usage breakdown- SQL 200n
++!     protected static final int SYSTEM_CHECK_COLUMN_USAGE  = 36;
++!     protected static final int SYSTEM_CHECK_ROUTINE_USAGE = 37;
++!     protected static final int SYSTEM_CHECK_TABLE_USAGE   = 38;
++!     protected static final int SYSTEM_VIEW_COLUMN_USAGE   = 39;
++!     protected static final int SYSTEM_VIEW_TABLE_USAGE    = 40;
++!     protected static final int SYSTEM_VIEW_ROUTINE_USAGE  = 41;
++  
++  // boucherb@users 20050514 - further SQL 200n metdata support
++!     protected static final int SYSTEM_AUTHORIZATIONS                 = 42;
++!     protected static final int SYSTEM_COLLATIONS                     = 43;
++!     protected static final int SYSTEM_ROLE_AUTHORIZATION_DESCRIPTORS = 44;
++!     protected static final int SYSTEM_SCHEMATA                       = 45;
++  
++      /** system table names strictly in order of their ids */
++!     protected static final String[] sysTableNames = {
++          "SYSTEM_BESTROWIDENTIFIER",                 //
++          "SYSTEM_CATALOGS",                          //
++          "SYSTEM_COLUMNPRIVILEGES",                  //
++--- 56,124 ----
++  class DatabaseInformation {
++  
++      // ids for system table names strictly in order of sysTableNames[]
++!     public static final int SYSTEM_BESTROWIDENTIFIER = 0;
++!     public static final int SYSTEM_CATALOGS          = 1;
++!     public static final int SYSTEM_COLUMNPRIVILEGES  = 2;
++!     public static final int SYSTEM_COLUMNS           = 3;
++!     public static final int SYSTEM_CROSSREFERENCE    = 4;
++!     public static final int SYSTEM_INDEXINFO         = 5;
++!     public static final int SYSTEM_PRIMARYKEYS       = 6;
++!     public static final int SYSTEM_PROCEDURECOLUMNS  = 7;
++!     public static final int SYSTEM_PROCEDURES        = 8;
++!     public static final int SYSTEM_SCHEMAS           = 9;
++!     public static final int SYSTEM_SUPERTABLES       = 10;
++!     public static final int SYSTEM_SUPERTYPES        = 11;
++!     public static final int SYSTEM_TABLEPRIVILEGES   = 12;
++!     public static final int SYSTEM_TABLES            = 13;
++!     public static final int SYSTEM_TABLETYPES        = 14;
++!     public static final int SYSTEM_TYPEINFO          = 15;
++!     public static final int SYSTEM_UDTATTRIBUTES     = 16;
++!     public static final int SYSTEM_UDTS              = 17;
++!     public static final int SYSTEM_USERS             = 18;
++!     public static final int SYSTEM_VERSIONCOLUMNS    = 19;
++  
++      // HSQLDB-specific
++!     public static final int SYSTEM_ALIASES         = 20;
++!     public static final int SYSTEM_BYTECODE        = 21;
++!     public static final int SYSTEM_CACHEINFO       = 22;
++!     public static final int SYSTEM_CLASSPRIVILEGES = 23;
++!     public static final int SYSTEM_SESSIONINFO     = 24;
++!     public static final int SYSTEM_PROPERTIES      = 25;
++!     public static final int SYSTEM_SESSIONS        = 26;
++!     public static final int SYSTEM_TRIGGERCOLUMNS  = 27;
++!     public static final int SYSTEM_TRIGGERS        = 28;
++!     public static final int SYSTEM_ALLTYPEINFO     = 29;
++  
++  // boucherb@users 20030305 - brought in line with SQL 200n
++!     public static final int SYSTEM_VIEWS = 30;
++  
++  // boucherb@users 20030403 - isolated and improved text table reporting
++!     public static final int SYSTEM_TEXTTABLES = 31;
++  
++  // boucherb@users 20040107 - metadata support for sequences
++!     public static final int SYSTEM_SEQUENCES        = 32;
++!     public static final int SYSTEM_USAGE_PRIVILEGES = 33;
++  
++  // boucherb@users 20040107 - metadata support for constraints
++!     public static final int SYSTEM_CHECK_CONSTRAINTS = 34;
++!     public static final int SYSTEM_TABLE_CONSTRAINTS = 35;
++  
++  // boucherb@users 20040107 - metadata support for view usage breakdown- SQL 200n
++!     public static final int SYSTEM_CHECK_COLUMN_USAGE  = 36;
++!     public static final int SYSTEM_CHECK_ROUTINE_USAGE = 37;
++!     public static final int SYSTEM_CHECK_TABLE_USAGE   = 38;
++!     public static final int SYSTEM_VIEW_COLUMN_USAGE   = 39;
++!     public static final int SYSTEM_VIEW_TABLE_USAGE    = 40;
++!     public static final int SYSTEM_VIEW_ROUTINE_USAGE  = 41;
++  
++  // boucherb@users 20050514 - further SQL 200n metdata support
++!     public static final int SYSTEM_AUTHORIZATIONS                 = 42;
++!     public static final int SYSTEM_COLLATIONS                     = 43;
++!     public static final int SYSTEM_ROLE_AUTHORIZATION_DESCRIPTORS = 44;
++!     public static final int SYSTEM_SCHEMATA                       = 45;
++  
++      /** system table names strictly in order of their ids */
++!     public static final String[] sysTableNames = {
++          "SYSTEM_BESTROWIDENTIFIER",                 //
++          "SYSTEM_CATALOGS",                          //
++          "SYSTEM_COLUMNPRIVILEGES",                  //
++***************
++*** 266,272 ****
++      };
++  
++      /** Map: table name => table id */
++!     protected static final IntValueHashMap sysTableNamesMap;
++  
++      static {
++          sysTableNamesMap = new IntValueHashMap(47);
++--- 266,272 ----
++      };
++  
++      /** Map: table name => table id */
++!     public static final IntValueHashMap sysTableNamesMap;
++  
++      static {
++          sysTableNamesMap = new IntValueHashMap(47);
++***************
++*** 281,293 ****
++      }
++  
++      /** Database for which to produce tables */
++!     protected final Database database;
++  
++      /**
++       * Simple object-wide flag indicating that all of this object's cached
++       * data is dirty.
++       */
++!     protected boolean isDirty = true;
++  
++      /**
++       * state flag -- if true, contentful tables are to be produced, else
++--- 281,293 ----
++      }
++  
++      /** Database for which to produce tables */
++!     public final Database database;
++  
++      /**
++       * Simple object-wide flag indicating that all of this object's cached
++       * data is dirty.
++       */
++!     public boolean isDirty = true;
++  
++      /**
++       * state flag -- if true, contentful tables are to be produced, else
++***************
++*** 295,301 ****
++       * database startup where user views reference system tables and faster
++       * system table structural reflection for table metadata.
++       */
++!     protected boolean withContent = false;
++  
++      /**
++       * Factory method retuns the fullest system table producer
++--- 295,301 ----
++       * database startup where user views reference system tables and faster
++       * system table structural reflection for table metadata.
++       */
++!     public boolean withContent = false;
++  
++      /**
++       * Factory method retuns the fullest system table producer
++diff -crN hsqldb-old/src/org/hsqldb/DatabaseInformationMain.java hsqldb/src/org/hsqldb/DatabaseInformationMain.java
++*** hsqldb-old/src/org/hsqldb/DatabaseInformationMain.java	2007-06-11 12:12:28.000000000 +0200
++--- hsqldb/src/org/hsqldb/DatabaseInformationMain.java	2007-11-04 00:13:48.000000000 +0100
++***************
++*** 118,157 ****
++      // HsqlName objects for the system tables
++  
++      /** The HsqlNames of the system tables. */
++!     protected static final HsqlName[] sysTableHsqlNames;
++  
++      /** Current user for each cached system table */
++!     protected final int[] sysTableSessions = new int[sysTableNames.length];
++  
++      /** true if the contents of a cached system table depends on the session */
++!     protected final boolean[] sysTableSessionDependent =
++          new boolean[sysTableNames.length];
++  
++      /** cache of system tables */
++!     protected final Table[] sysTables = new Table[sysTableNames.length];
++  
++      /** Set: { names of system tables that are not to be cached } */
++!     protected static final HashSet nonCachedTablesSet;
++  
++      /**
++       * Map: simple <code>Column</code> name <code>String</code> object =>
++       * <code>HsqlName</code> object.
++       */
++!     protected static final HashMap columnNameMap;
++  
++      /**
++       * The <code>Session</code> object under consideration in the current
++       * executution context.
++       */
++!     protected Session session;
++  
++      /** The table types HSQLDB supports. */
++!     protected static final String[] tableTypes = new String[] {
++          "GLOBAL TEMPORARY", "SYSTEM TABLE", "TABLE", "VIEW"
++      };
++  
++      /** Provides naming support. */
++!     protected DINameSpace ns;
++  
++      static {
++          columnNameMap      = new HashMap();
++--- 118,157 ----
++      // HsqlName objects for the system tables
++  
++      /** The HsqlNames of the system tables. */
++!     public static final HsqlName[] sysTableHsqlNames;
++  
++      /** Current user for each cached system table */
++!     public final int[] sysTableSessions = new int[sysTableNames.length];
++  
++      /** true if the contents of a cached system table depends on the session */
++!     public final boolean[] sysTableSessionDependent =
++          new boolean[sysTableNames.length];
++  
++      /** cache of system tables */
++!     public final Table[] sysTables = new Table[sysTableNames.length];
++  
++      /** Set: { names of system tables that are not to be cached } */
++!     public static final HashSet nonCachedTablesSet;
++  
++      /**
++       * Map: simple <code>Column</code> name <code>String</code> object =>
++       * <code>HsqlName</code> object.
++       */
++!     public static final HashMap columnNameMap;
++  
++      /**
++       * The <code>Session</code> object under consideration in the current
++       * executution context.
++       */
++!     public Session session;
++  
++      /** The table types HSQLDB supports. */
++!     public static final String[] tableTypes = new String[] {
++          "GLOBAL TEMPORARY", "SYSTEM TABLE", "TABLE", "VIEW"
++      };
++  
++      /** Provides naming support. */
++!     public DINameSpace ns;
++  
++      static {
++          columnNameMap      = new HashMap();
++***************
++*** 218,224 ****
++       * @throws HsqlException if a problem occurs when adding the
++       *      column (e.g. duplicate name)
++       */
++!     protected final void addColumn(Table t, String name, int type, int size,
++                                     boolean nullable) throws HsqlException {
++  
++          HsqlName cn;
++--- 218,224 ----
++       * @throws HsqlException if a problem occurs when adding the
++       *      column (e.g. duplicate name)
++       */
++!     public final void addColumn(Table t, String name, int type, int size,
++                                     boolean nullable) throws HsqlException {
++  
++          HsqlName cn;
++***************
++*** 249,255 ****
++       * @throws HsqlException if a problem occurs when adding the
++       *      column (e.g. duplicate name)
++       */
++!     protected final void addColumn(Table t, String name, int type,
++                                     boolean nullable) throws HsqlException {
++          addColumn(t, name, type, 0, nullable);
++      }
++--- 249,255 ----
++       * @throws HsqlException if a problem occurs when adding the
++       *      column (e.g. duplicate name)
++       */
++!     public final void addColumn(Table t, String name, int type,
++                                     boolean nullable) throws HsqlException {
++          addColumn(t, name, type, 0, nullable);
++      }
++***************
++*** 264,270 ****
++       * @throws HsqlException if a problem occurs when adding the
++       *      column (e.g. duplicate name)
++       */
++!     protected final void addColumn(Table t, String name,
++                                     int type) throws HsqlException {
++          addColumn(t, name, type, true);
++      }
++--- 264,270 ----
++       * @throws HsqlException if a problem occurs when adding the
++       *      column (e.g. duplicate name)
++       */
++!     public final void addColumn(Table t, String name,
++                                     int type) throws HsqlException {
++          addColumn(t, name, type, true);
++      }
++***************
++*** 276,282 ****
++       *
++       * @return an enumeration over all of the tables in this database
++       */
++!     protected final Iterator allTables() {
++          return new WrapperIterator(database.schemaManager.allTablesIterator(),
++                                     new WrapperIterator(sysTables, true));
++      }
++--- 276,282 ----
++       *
++       * @return an enumeration over all of the tables in this database
++       */
++!     public final Iterator allTables() {
++          return new WrapperIterator(database.schemaManager.allTablesIterator(),
++                                     new WrapperIterator(sysTables, true));
++      }
++***************
++*** 287,293 ****
++       *
++       * @throws HsqlException if a database access error occurs
++       */
++!     protected final void cacheClear() throws HsqlException {
++  
++          int i = sysTables.length;
++  
++--- 287,293 ----
++       *
++       * @throws HsqlException if a database access error occurs
++       */
++!     public final void cacheClear() throws HsqlException {
++  
++          int i = sysTables.length;
++  
++***************
++*** 312,318 ****
++       * @throws HsqlException if a database access error occurs
++       * @return the system table corresponding to the specified tableIndex value
++       */
++!     protected Table generateTable(int tableIndex) throws HsqlException {
++  
++          Table t = sysTables[tableIndex];
++  
++--- 312,318 ----
++       * @throws HsqlException if a database access error occurs
++       * @return the system table corresponding to the specified tableIndex value
++       */
++!     public Table generateTable(int tableIndex) throws HsqlException {
++  
++          Table t = sysTables[tableIndex];
++  
++***************
++*** 417,423 ****
++       *
++       * @throws HsqlException if a database access error occurs
++       */
++!     protected final void init() throws HsqlException {
++  
++          ns = new DINameSpace(database);
++  
++--- 417,423 ----
++       *
++       * @throws HsqlException if a database access error occurs
++       */
++!     public final void init() throws HsqlException {
++  
++          ns = new DINameSpace(database);
++  
++***************
++*** 488,494 ****
++       * @param table the table for which to check accessibility
++       * @throws HsqlException if a database access error occurs
++       */
++!     protected final boolean isAccessibleTable(Table table)
++      throws HsqlException {
++          return session.isAccessible(table.getName());
++      }
++--- 488,494 ----
++       * @param table the table for which to check accessibility
++       * @throws HsqlException if a database access error occurs
++       */
++!     public final boolean isAccessibleTable(Table table)
++      throws HsqlException {
++          return session.isAccessible(table.getName());
++      }
++***************
++*** 500,506 ****
++       * @param name of the table
++       * @throws HsqlException if a database access error occurs
++       */
++!     protected final Table createBlankTable(HsqlName name)
++      throws HsqlException {
++          return new Table(database, name, Table.SYSTEM_TABLE);
++      }
++--- 500,506 ----
++       * @param name of the table
++       * @throws HsqlException if a database access error occurs
++       */
++!     public final Table createBlankTable(HsqlName name)
++      throws HsqlException {
++          return new Table(database, name, Table.SYSTEM_TABLE);
++      }
++diff -crN hsqldb-old/src/org/hsqldb/Database.java hsqldb/src/org/hsqldb/Database.java
++*** hsqldb-old/src/org/hsqldb/Database.java	2007-10-22 07:53:38.000000000 +0200
++--- hsqldb/src/org/hsqldb/Database.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 124,136 ****
++      String sName;
++  
++  // loosecannon1@users 1.7.2 patch properties on the JDBC URL
++!     private HsqlProperties urlProperties;
++!     private String         sPath;
++      DatabaseInformation    dbInfo;
++      ClassLoader            classLoader;
++  
++      /** indicates the state of the database */
++!     private int   dbState;
++      public Logger logger;
++  
++      /** true means that all tables are readonly. */
++--- 124,136 ----
++      String sName;
++  
++  // loosecannon1@users 1.7.2 patch properties on the JDBC URL
++!     public HsqlProperties urlProperties;
++!     public String         sPath;
++      DatabaseInformation    dbInfo;
++      ClassLoader            classLoader;
++  
++      /** indicates the state of the database */
++!     public int   dbState;
++      public Logger logger;
++  
++      /** true means that all tables are readonly. */
++***************
++*** 140,158 ****
++       * true means that all CACHED and TEXT tables are readonly.
++       *  MEMORY tables are updatable but updates are not persisted.
++       */
++!     private boolean filesReadOnly;
++  
++      /** true means filesReadOnly but CACHED and TEXT tables are disallowed */
++!     private boolean                filesInJar;
++      public boolean                 sqlEnforceStrictSize;
++      public int                     firstIdentity;
++!     private boolean                bIgnoreCase;
++!     private boolean                bReferentialIntegrity;
++!     private HsqlDatabaseProperties databaseProperties;
++!     private boolean                shutdownOnNoConnection;
++  
++      // schema invarient objects
++!     private HashMap        hAlias;
++      public UserManager     userManager;
++      public GranteeManager  granteeManager;
++      public HsqlNameManager nameManager;
++--- 140,158 ----
++       * true means that all CACHED and TEXT tables are readonly.
++       *  MEMORY tables are updatable but updates are not persisted.
++       */
++!     public boolean filesReadOnly;
++  
++      /** true means filesReadOnly but CACHED and TEXT tables are disallowed */
++!     public boolean                filesInJar;
++      public boolean                 sqlEnforceStrictSize;
++      public int                     firstIdentity;
++!     public boolean                bIgnoreCase;
++!     public boolean                bReferentialIntegrity;
++!     public HsqlDatabaseProperties databaseProperties;
++!     public boolean                shutdownOnNoConnection;
++  
++      // schema invarient objects
++!     public HashMap        hAlias;
++      public UserManager     userManager;
++      public GranteeManager  granteeManager;
++      public HsqlNameManager nameManager;
++***************
++*** 526,532 ****
++       *  Called by the garbage collector on this Databases object when garbage
++       *  collection determines that there are no more references to it.
++       */
++!     protected void finalize() {
++  
++          if (getState() != DATABASE_ONLINE) {
++              return;
++--- 526,532 ----
++       *  Called by the garbage collector on this Databases object when garbage
++       *  collection determines that there are no more references to it.
++       */
++!     public void finalize() {
++  
++          if (getState() != DATABASE_ONLINE) {
++              return;
++***************
++*** 639,645 ****
++          }
++      }
++  
++!     private synchronized void setState(int state) {
++          dbState = state;
++      }
++  
++--- 639,645 ----
++          }
++      }
++  
++!     public synchronized void setState(int state) {
++          dbState = state;
++      }
++  
++***************
++*** 687,694 ****
++          return urlProperties;
++      }
++  
++!     private FileAccess fileaccess;
++!     private boolean    isStoredFileAccess;
++  
++      public synchronized FileAccess getFileAccess() {
++          return fileaccess;
++--- 687,694 ----
++          return urlProperties;
++      }
++  
++!     public FileAccess fileaccess;
++!     public boolean    isStoredFileAccess;
++  
++      public synchronized FileAccess getFileAccess() {
++          return fileaccess;
++diff -crN hsqldb-old/src/org/hsqldb/DatabaseManager.java hsqldb/src/org/hsqldb/DatabaseManager.java
++*** hsqldb-old/src/org/hsqldb/DatabaseManager.java	2007-10-11 11:32:16.000000000 +0200
++--- hsqldb/src/org/hsqldb/DatabaseManager.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 62,68 ****
++      // Database and Server registry
++  
++      /** provides unique ID's for the Databases currently in registry */
++!     private static int dbIDCounter;
++  
++      /** name to Database mapping for mem: databases */
++      static final HashMap memDatabaseMap = new HashMap();
++--- 62,68 ----
++      // Database and Server registry
++  
++      /** provides unique ID's for the Databases currently in registry */
++!     public static int dbIDCounter;
++  
++      /** name to Database mapping for mem: databases */
++      static final HashMap memDatabaseMap = new HashMap();
++***************
++*** 235,241 ****
++      }
++  
++  // loosecannon1@users 1.7.2 patch properties on the JDBC URL
++!     private static synchronized Database getDatabaseObject(String type,
++              String path, HsqlProperties props) throws HsqlException {
++  
++          Database db;
++--- 235,241 ----
++      }
++  
++  // loosecannon1@users 1.7.2 patch properties on the JDBC URL
++!     public static synchronized Database getDatabaseObject(String type,
++              String path, HsqlProperties props) throws HsqlException {
++  
++          Database db;
++***************
++*** 274,280 ****
++       * Looks up database of a given type and path in the registry. Returns
++       * null if there is none.
++       */
++!     private static synchronized Database lookupDatabaseObject(String type,
++              String path) throws HsqlException {
++  
++          Object  key = path;
++--- 274,280 ----
++       * Looks up database of a given type and path in the registry. Returns
++       * null if there is none.
++       */
++!     public static synchronized Database lookupDatabaseObject(String type,
++              String path) throws HsqlException {
++  
++          Object  key = path;
++***************
++*** 300,306 ****
++       * Adds a database to the registry. Returns
++       * null if there is none.
++       */
++!     private static synchronized void addDatabaseObject(String type,
++              String path, Database db) throws HsqlException {
++  
++          Object  key = path;
++--- 300,306 ----
++       * Adds a database to the registry. Returns
++       * null if there is none.
++       */
++!     public static synchronized void addDatabaseObject(String type,
++              String path, Database db) throws HsqlException {
++  
++          Object  key = path;
++***************
++*** 407,413 ****
++      /**
++       * Deregisters a server as serving a given database. Not yet used.
++       */
++!     private static void deRegisterServer(Server server, Database db) {
++  
++          Iterator it = serverMap.values().iterator();
++  
++--- 407,413 ----
++      /**
++       * Deregisters a server as serving a given database. Not yet used.
++       */
++!     public static void deRegisterServer(Server server, Database db) {
++  
++          Iterator it = serverMap.values().iterator();
++  
++***************
++*** 425,431 ****
++      /**
++       * Registers a server as serving a given database.
++       */
++!     private static void registerServer(Server server, Database db) {
++  
++          if (!serverMap.containsKey(server)) {
++              serverMap.put(server, new HashSet());
++--- 425,431 ----
++      /**
++       * Registers a server as serving a given database.
++       */
++!     public static void registerServer(Server server, Database db) {
++  
++          if (!serverMap.containsKey(server)) {
++              serverMap.put(server, new HashSet());
++***************
++*** 440,446 ****
++       * Notifies all servers that serve the database that the database has been
++       * shutdown.
++       */
++!     private static void notifyServers(Database db) {
++  
++          Iterator it = serverMap.keySet().iterator();
++  
++--- 440,446 ----
++       * Notifies all servers that serve the database that the database has been
++       * shutdown.
++       */
++!     public static void notifyServers(Database db) {
++  
++          Iterator it = serverMap.keySet().iterator();
++  
++***************
++*** 472,478 ****
++      }
++  
++      // Timer
++!     private static final HsqlTimer timer = new HsqlTimer();
++  
++      public static HsqlTimer getTimer() {
++          return timer;
++--- 472,478 ----
++      }
++  
++      // Timer
++!     public static final HsqlTimer timer = new HsqlTimer();
++  
++      public static HsqlTimer getTimer() {
++          return timer;
++***************
++*** 480,486 ****
++  
++      // converts file path to database lookup key, converting any
++      // thrown exception to an HsqlException in the process
++!     private static String filePathToKey(String path) throws HsqlException {
++  
++          try {
++              return FileUtil.getDefaultInstance().canonicalPath(path);
++--- 480,486 ----
++  
++      // converts file path to database lookup key, converting any
++      // thrown exception to an HsqlException in the process
++!     public static String filePathToKey(String path) throws HsqlException {
++  
++          try {
++              return FileUtil.getDefaultInstance().canonicalPath(path);
++diff -crN hsqldb-old/src/org/hsqldb/DatabaseScript.java hsqldb/src/org/hsqldb/DatabaseScript.java
++*** hsqldb-old/src/org/hsqldb/DatabaseScript.java	2007-07-23 20:30:48.000000000 +0200
++--- hsqldb/src/org/hsqldb/DatabaseScript.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 663,669 ****
++      /**
++       * Generates the column definitions for a table.
++       */
++!     private static void getColumnList(Table t, int[] col, int len,
++                                        StringBuffer a) {
++  
++          a.append('(');
++--- 663,669 ----
++      /**
++       * Generates the column definitions for a table.
++       */
++!     public static void getColumnList(Table t, int[] col, int len,
++                                        StringBuffer a) {
++  
++          a.append('(');
++***************
++*** 682,688 ****
++      /**
++       * Generates the foreign key declaration for a given Constraint object.
++       */
++!     private static void getFKStatement(Constraint c, StringBuffer a) {
++  
++          a.append(Token.T_CONSTRAINT).append(' ');
++          a.append(c.getName().statementName);
++--- 682,688 ----
++      /**
++       * Generates the foreign key declaration for a given Constraint object.
++       */
++!     public static void getFKStatement(Constraint c, StringBuffer a) {
++  
++          a.append(Token.T_CONSTRAINT).append(' ');
++          a.append(c.getName().statementName);
++***************
++*** 714,720 ****
++      /**
++       * Returns the foreign key action rule.
++       */
++!     private static String getFKAction(int action) {
++  
++          switch (action) {
++  
++--- 714,720 ----
++      /**
++       * Returns the foreign key action rule.
++       */
++!     public static String getFKAction(int action) {
++  
++          switch (action) {
++  
++***************
++*** 735,741 ****
++      /**
++       * Adds a script line to the result.
++       */
++!     private static void addRow(Result r, String sql) {
++  
++          if (sql == null || sql.length() == 0) {
++              return;
++--- 735,741 ----
++      /**
++       * Adds a script line to the result.
++       */
++!     public static void addRow(Result r, String sql) {
++  
++          if (sql == null || sql.length() == 0) {
++              return;
++***************
++*** 760,766 ****
++       * grant select on system tables
++       *
++       */
++!     private static void addRightsStatements(Database dDatabase, Result r) {
++  
++          StringBuffer   a;
++          HashMappedList userlist = dDatabase.getUserManager().getUsers();
++--- 760,766 ----
++       * grant select on system tables
++       *
++       */
++!     public static void addRightsStatements(Database dDatabase, Result r) {
++  
++          StringBuffer   a;
++          HashMappedList userlist = dDatabase.getUserManager().getUsers();
++diff -crN hsqldb-old/src/org/hsqldb/DINameSpace.java hsqldb/src/org/hsqldb/DINameSpace.java
++*** hsqldb-old/src/org/hsqldb/DINameSpace.java	2006-04-11 17:13:22.000000000 +0200
++--- hsqldb/src/org/hsqldb/DINameSpace.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 61,70 ****
++  final class DINameSpace {
++  
++      /** The Database for which the name space functionality is provided */
++!     private Database database;
++  
++      /** The catalog name reported by this namespace */
++!     private String catalogName;
++  
++      /**
++       * Set { <code>Class</code> FQN <code>String</code> objects }. <p>
++--- 61,70 ----
++  final class DINameSpace {
++  
++      /** The Database for which the name space functionality is provided */
++!     public Database database;
++  
++      /** The catalog name reported by this namespace */
++!     public String catalogName;
++  
++      /**
++       * Set { <code>Class</code> FQN <code>String</code> objects }. <p>
++***************
++*** 74,80 ****
++       * support of the expected SQL CLI scalar functions and other core
++       * HSQLDB SQL functions and stored procedures. <p>
++       */
++!     private static HashSet builtin = new HashSet();
++  
++      // procedure columns
++      // make temporary ad-hoc spec a little more "official"
++--- 74,80 ----
++       * support of the expected SQL CLI scalar functions and other core
++       * HSQLDB SQL functions and stored procedures. <p>
++       */
++!     public static HashSet builtin = new HashSet();
++  
++      // procedure columns
++      // make temporary ad-hoc spec a little more "official"
++diff -crN hsqldb-old/src/org/hsqldb/DIProcedureInfo.java hsqldb/src/org/hsqldb/DIProcedureInfo.java
++*** hsqldb-old/src/org/hsqldb/DIProcedureInfo.java	2005-10-23 21:25:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/DIProcedureInfo.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 70,94 ****
++      static final int      procedureNoNulls         = 0;
++      static final int      procedureNullable        = 1;
++      static final int      procedureNullableUnknown = 2;
++!     private Class         clazz;
++!     private Class[]       colClasses;
++!     private int[]         colTypes;
++!     private int           colOffset;
++!     private int           colCount;
++!     private boolean       colsResolved;
++!     private String        fqn;
++!     private String        specificName;
++!     private int           hnd_remarks;
++!     private Method        method;
++!     private String        sig;
++!     private DINameSpace   nameSpace;
++!     private final HashMap typeMap = new HashMap();
++  
++      public DIProcedureInfo(DINameSpace ns) throws HsqlException {
++          setNameSpace(ns);
++      }
++  
++!     private int colOffset() {
++  
++          if (!colsResolved) {
++              resolveCols();
++--- 70,94 ----
++      static final int      procedureNoNulls         = 0;
++      static final int      procedureNullable        = 1;
++      static final int      procedureNullableUnknown = 2;
++!     public Class         clazz;
++!     public Class[]       colClasses;
++!     public int[]         colTypes;
++!     public int           colOffset;
++!     public int           colCount;
++!     public boolean       colsResolved;
++!     public String        fqn;
++!     public String        specificName;
++!     public int           hnd_remarks;
++!     public Method        method;
++!     public String        sig;
++!     public DINameSpace   nameSpace;
++!     public final HashMap typeMap = new HashMap();
++  
++      public DIProcedureInfo(DINameSpace ns) throws HsqlException {
++          setNameSpace(ns);
++      }
++  
++!     public int colOffset() {
++  
++          if (!colsResolved) {
++              resolveCols();
++***************
++*** 512,518 ****
++          } catch (Exception e) {}
++      }
++  
++!     private void resolveCols() {
++  
++          Class   rType;
++          Class[] pTypes;
++--- 512,518 ----
++          } catch (Exception e) {}
++      }
++  
++!     public void resolveCols() {
++  
++          Class   rType;
++          Class[] pTypes;
++diff -crN hsqldb-old/src/org/hsqldb/DiskNode.java hsqldb/src/org/hsqldb/DiskNode.java
++*** hsqldb-old/src/org/hsqldb/DiskNode.java	2006-06-28 23:53:48.000000000 +0200
++--- hsqldb/src/org/hsqldb/DiskNode.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 93,103 ****
++   */
++  class DiskNode extends Node {
++  
++!     protected Row    rData;
++!     private int      iLeft   = NO_POS;
++!     private int      iRight  = NO_POS;
++!     private int      iParent = NO_POS;
++!     private int      iId;    // id of Index object for this Node
++      static final int SIZE_IN_BYTE = 4 * 4;
++  
++      DiskNode(CachedRow r, RowInputInterface in,
++--- 93,103 ----
++   */
++  class DiskNode extends Node {
++  
++!     public Row    rData;
++!     public int      iLeft   = NO_POS;
++!     public int      iRight  = NO_POS;
++!     public int      iParent = NO_POS;
++!     public int      iId;    // id of Index object for this Node
++      static final int SIZE_IN_BYTE = 4 * 4;
++  
++      DiskNode(CachedRow r, RowInputInterface in,
++***************
++*** 162,168 ****
++          return rData;
++      }
++  
++!     private Node findNode(int pos) throws HsqlException {
++  
++          Node ret = null;
++          Row  r   = ((CachedRow) rData).getTable().getRow(pos);
++--- 162,168 ----
++          return rData;
++      }
++  
++!     public Node findNode(int pos) throws HsqlException {
++  
++          Node ret = null;
++          Row  r   = ((CachedRow) rData).getTable().getRow(pos);
++***************
++*** 378,384 ****
++          writeTranslatePointer(iParent, out, lookup);
++      }
++  
++!     private void writeTranslatePointer(int pointer, RowOutputInterface out,
++                                         IntLookup lookup) {
++  
++          int newPointer = 0;
++--- 378,384 ----
++          writeTranslatePointer(iParent, out, lookup);
++      }
++  
++!     public void writeTranslatePointer(int pointer, RowOutputInterface out,
++                                         IntLookup lookup) {
++  
++          int newPointer = 0;
++diff -crN hsqldb-old/src/org/hsqldb/DITableInfo.java hsqldb/src/org/hsqldb/DITableInfo.java
++*** hsqldb-old/src/org/hsqldb/DITableInfo.java	2007-01-08 14:51:12.000000000 +0100
++--- hsqldb/src/org/hsqldb/DITableInfo.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 55,73 ****
++      static final short tableIndexOther    = 3;
++  
++      /** Used in buffer size and character octet length determinations. */
++!     private static final int HALF_MAX_INT = Integer.MAX_VALUE >>> 1;
++  
++      /** BundleHandler id for column remarks resource bundle. */
++!     private int hnd_column_remarks = -1;
++  
++      /** BundleHandler id for table remarks resource bundle. */
++!     private int hnd_table_remarks = -1;
++  
++      /** The Table object upon which this object is reporting. */
++!     private Table table;
++  
++      /** Provides intrinsic type infformation support. */
++!     private static final DITypeInfo ti = new DITypeInfo();
++  
++      /**
++       * Creates a new DITableInfo object with the default Locale and reporting
++--- 55,73 ----
++      static final short tableIndexOther    = 3;
++  
++      /** Used in buffer size and character octet length determinations. */
++!     public static final int HALF_MAX_INT = Integer.MAX_VALUE >>> 1;
++  
++      /** BundleHandler id for column remarks resource bundle. */
++!     public int hnd_column_remarks = -1;
++  
++      /** BundleHandler id for table remarks resource bundle. */
++!     public int hnd_table_remarks = -1;
++  
++      /** The Table object upon which this object is reporting. */
++!     public Table table;
++  
++      /** Provides intrinsic type infformation support. */
++!     public static final DITypeInfo ti = new DITypeInfo();
++  
++      /**
++       * Creates a new DITableInfo object with the default Locale and reporting
++diff -crN hsqldb-old/src/org/hsqldb/DITypeInfo.java hsqldb/src/org/hsqldb/DITypeInfo.java
++*** hsqldb-old/src/org/hsqldb/DITypeInfo.java	2007-01-09 15:57:14.000000000 +0100
++--- hsqldb/src/org/hsqldb/DITypeInfo.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 57,75 ****
++      static final int typeSearchable = 3;
++  
++      /** BundleHandler id for create params resource bundle. */
++!     private int hnd_create_params = -1;
++  
++      /** BundleHandler id for local names resource bundle. */
++!     private int hnd_local_names = -1;
++  
++      /** BundleHandler id for data type remarks resource bundle. */
++!     private int hnd_remarks = -1;
++  
++      /** The SQL type code on which this object is reporting. */
++!     private int type = Types.NULL;
++  
++      /** The HSQLDB subtype code on which this object is reporting. */
++!     private int typeSub = Types.TYPE_SUB_DEFAULT;
++      boolean     locale_set;
++  
++      /** Creates a new DITypeInfo object having the default Locale. */
++--- 57,75 ----
++      static final int typeSearchable = 3;
++  
++      /** BundleHandler id for create params resource bundle. */
++!     public int hnd_create_params = -1;
++  
++      /** BundleHandler id for local names resource bundle. */
++!     public int hnd_local_names = -1;
++  
++      /** BundleHandler id for data type remarks resource bundle. */
++!     public int hnd_remarks = -1;
++  
++      /** The SQL type code on which this object is reporting. */
++!     public int type = Types.NULL;
++  
++      /** The HSQLDB subtype code on which this object is reporting. */
++!     public int typeSub = Types.TYPE_SUB_DEFAULT;
++      boolean     locale_set;
++  
++      /** Creates a new DITypeInfo object having the default Locale. */
++diff -crN hsqldb-old/src/org/hsqldb/Expression.java hsqldb/src/org/hsqldb/Expression.java
++*** hsqldb-old/src/org/hsqldb/Expression.java	2007-07-23 20:30:48.000000000 +0200
++--- hsqldb/src/org/hsqldb/Expression.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 222,249 ****
++          });
++      }
++  
++!     private static final int AGGREGATE_SELF     = -1;
++!     private static final int AGGREGATE_NONE     = 0;
++!     private static final int AGGREGATE_LEFT     = 1;
++!     private static final int AGGREGATE_RIGHT    = 2;
++!     private static final int AGGREGATE_BOTH     = 3;
++!     private static final int AGGREGATE_FUNCTION = 4;
++  
++      // type
++      int         exprType;
++!     private int aggregateSpec = AGGREGATE_NONE;
++  
++      // nodes
++      Expression eArg, eArg2;
++  
++      // VALUE
++      Object      valueData;
++!     private int dataType;
++  
++      // VALUE LIST NEW
++      HashSet         hList;
++      Expression[]    valueList;
++!     private boolean isFixedConstantValueList;
++  
++      // QUERY - in single value selects, IN or EXISTS predicates
++      SubQuery subQuery;
++--- 222,249 ----
++          });
++      }
++  
++!     public static final int AGGREGATE_SELF     = -1;
++!     public static final int AGGREGATE_NONE     = 0;
++!     public static final int AGGREGATE_LEFT     = 1;
++!     public static final int AGGREGATE_RIGHT    = 2;
++!     public static final int AGGREGATE_BOTH     = 3;
++!     public static final int AGGREGATE_FUNCTION = 4;
++  
++      // type
++      int         exprType;
++!     public int aggregateSpec = AGGREGATE_NONE;
++  
++      // nodes
++      Expression eArg, eArg2;
++  
++      // VALUE
++      Object      valueData;
++!     public int dataType;
++  
++      // VALUE LIST NEW
++      HashSet         hList;
++      Expression[]    valueList;
++!     public boolean isFixedConstantValueList;
++  
++      // QUERY - in single value selects, IN or EXISTS predicates
++      SubQuery subQuery;
++***************
++*** 253,283 ****
++      Function function;
++  
++      // LIKE
++!     private Like likeObject;
++  
++      // COLUMN
++!     private String      catalog;
++!     private String      schema;
++!     private String      tableName;
++!     private String      columnName;
++!     private TableFilter tableFilter;                // null if not yet resolved
++      TableFilter         outerFilter;                // defined if this is part of an OUTER JOIN condition tree
++  
++      // COLUMN
++!     private int     columnIndex;
++!     private boolean columnQuoted;
++!     private int     precision;
++!     private int     scale;
++!     private String  columnAlias;                    // if it is a column of a select column list
++!     private boolean aliasQuoted;
++  
++      //
++!     private boolean isDescending;                   // if it is a column in a order by
++      int             joinedTableColumnIndex = -1;    // >= 0 when it is used for order by
++      boolean         isDistinctAggregate;
++  
++      // PARAM
++!     private boolean isParam;
++  
++      // does Expression stem from a JOIN <table> ON <expression>
++      boolean isInJoin;
++--- 253,283 ----
++      Function function;
++  
++      // LIKE
++!     public Like likeObject;
++  
++      // COLUMN
++!     public String      catalog;
++!     public String      schema;
++!     public String      tableName;
++!     public String      columnName;
++!     public TableFilter tableFilter;                // null if not yet resolved
++      TableFilter         outerFilter;                // defined if this is part of an OUTER JOIN condition tree
++  
++      // COLUMN
++!     public int     columnIndex;
++!     public boolean columnQuoted;
++!     public int     precision;
++!     public int     scale;
++!     public String  columnAlias;                    // if it is a column of a select column list
++!     public boolean aliasQuoted;
++  
++      //
++!     public boolean isDescending;                   // if it is a column in a order by
++      int             joinedTableColumnIndex = -1;    // >= 0 when it is used for order by
++      boolean         isDistinctAggregate;
++  
++      // PARAM
++!     public boolean isParam;
++  
++      // does Expression stem from a JOIN <table> ON <expression>
++      boolean isInJoin;
++***************
++*** 496,502 ****
++                 && scale == other.scale;
++      }
++  
++!     private void checkAggregate() {
++  
++          if (isAggregate(exprType)) {
++              aggregateSpec = AGGREGATE_SELF;
++--- 496,502 ----
++                 && scale == other.scale;
++      }
++  
++!     public void checkAggregate() {
++  
++          if (isAggregate(exprType)) {
++              aggregateSpec = AGGREGATE_SELF;
++***************
++*** 863,869 ****
++          throw Trace.error(Trace.EXPRESSION_NOT_SUPPORTED);
++      }
++  
++!     private String describe(Session session, int blanks) {
++  
++          int          lIType;
++          StringBuffer buf = new StringBuffer(64);
++--- 863,869 ----
++          throw Trace.error(Trace.EXPRESSION_NOT_SUPPORTED);
++      }
++  
++!     public String describe(Session session, int blanks) {
++  
++          int          lIType;
++          StringBuffer buf = new StringBuffer(64);
++***************
++*** 1244,1250 ****
++       *
++       * @return boolean
++       */
++!     private boolean isColumn() {
++  
++          switch (exprType) {
++  
++--- 1244,1250 ----
++       *
++       * @return boolean
++       */
++!     public boolean isColumn() {
++  
++          switch (exprType) {
++  
++***************
++*** 3506,3512 ****
++          return compareValues(session, o1, o2);
++      }
++  
++!     private Boolean compareValues(Session session, Object o1,
++                                    Object o2) throws HsqlException {
++  
++          int type = eArg.dataType;
++--- 3506,3512 ----
++          return compareValues(session, o1, o2);
++      }
++  
++!     public Boolean compareValues(Session session, Object o1,
++                                    Object o2) throws HsqlException {
++  
++          int type = eArg.dataType;
++***************
++*** 3564,3570 ****
++       * @return boolean
++       * @throws HsqlException
++       */
++!     private Boolean testInCondition(Session session,
++                                      Object o) throws HsqlException {
++  
++          if (o == null) {
++--- 3564,3570 ----
++       * @return boolean
++       * @throws HsqlException
++       */
++!     public Boolean testInCondition(Session session,
++                                      Object o) throws HsqlException {
++  
++          if (o == null) {
++***************
++*** 3628,3634 ****
++          throw Trace.error(Trace.WRONG_DATA_TYPE);
++      }
++  
++!     private Boolean testExistsCondition(Session session)
++      throws HsqlException {
++  
++          if (subQuery.isResolved) {
++--- 3628,3634 ----
++          throw Trace.error(Trace.WRONG_DATA_TYPE);
++      }
++  
++!     public Boolean testExistsCondition(Session session)
++      throws HsqlException {
++  
++          if (subQuery.isResolved) {
++***************
++*** 3642,3648 ****
++          }
++      }
++  
++!     private Boolean testAnyAllCondition(Session session,
++                                          Object o) throws HsqlException {
++  
++          if (o == null) {
++--- 3642,3648 ----
++          }
++      }
++  
++!     public Boolean testAnyAllCondition(Session session,
++                                          Object o) throws HsqlException {
++  
++          if (o == null) {
++***************
++*** 3665,3671 ****
++          return result;
++      }
++  
++!     private Boolean getAnyAllValue(Session session, Object o,
++                                     SubQuery subquery) throws HsqlException {
++  
++          boolean     empty    = subquery.table.isEmpty(session);
++--- 3665,3671 ----
++          return result;
++      }
++  
++!     public Boolean getAnyAllValue(Session session, Object o,
++                                     SubQuery subquery) throws HsqlException {
++  
++          boolean     empty    = subquery.table.isEmpty(session);
++diff -crN hsqldb-old/src/org/hsqldb/Function.java hsqldb/src/org/hsqldb/Function.java
++*** hsqldb-old/src/org/hsqldb/Function.java	2006-09-22 15:14:00.000000000 +0200
++--- hsqldb/src/org/hsqldb/Function.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 96,115 ****
++   */
++  class Function {
++  
++!     private String         sFunction;
++!     private Method         mMethod;
++!     private String         returnClassName;
++!     private Class[]        aArgClasses;
++!     private int            iReturnType;
++!     private int            iArgCount;
++!     private int            iSqlArgCount;
++!     private int            iSqlArgStart;
++!     private int[]          iArgType;
++!     private boolean[]      bArgNullable;
++      Expression[]           eArg;
++!     private boolean        bConnection;
++!     private static HashMap methodCache = new HashMap();
++!     private int            fID;
++      String                 name;        // name used to call function
++      boolean                isSimple;    //CURRENT_TIME, NOW etc.
++      boolean                hasAggregate;
++--- 96,115 ----
++   */
++  class Function {
++  
++!     public String         sFunction;
++!     public Method         mMethod;
++!     public String         returnClassName;
++!     public Class[]        aArgClasses;
++!     public int            iReturnType;
++!     public int            iArgCount;
++!     public int            iSqlArgCount;
++!     public int            iSqlArgStart;
++!     public int[]          iArgType;
++!     public boolean[]      bArgNullable;
++      Expression[]           eArg;
++!     public boolean        bConnection;
++!     public static HashMap methodCache = new HashMap();
++!     public int            fID;
++      String                 name;        // name used to call function
++      boolean                isSimple;    //CURRENT_TIME, NOW etc.
++      boolean                hasAggregate;
++***************
++*** 370,376 ****
++          // Library function throw HsqlException
++      }
++  
++!     private Object[] getArguments(Session session) throws HsqlException {
++  
++          int      i    = bConnection ? 1
++                                      : 0;
++--- 370,376 ----
++          // Library function throw HsqlException
++      }
++  
++!     public Object[] getArguments(Session session) throws HsqlException {
++  
++          int      i    = bConnection ? 1
++                                      : 0;
++***************
++*** 407,413 ****
++      /**
++       * returns null if any non-nullable element of values is null
++       */
++!     private Object[] getNotNull(Object[] values) throws HsqlException {
++  
++          int i = bConnection ? 1
++                              : 0;
++--- 407,413 ----
++      /**
++       * returns null if any non-nullable element of values is null
++       */
++!     public Object[] getNotNull(Object[] values) throws HsqlException {
++  
++          int i = bConnection ? 1
++                              : 0;
++diff -crN hsqldb-old/src/org/hsqldb/Grantee.java hsqldb/src/org/hsqldb/Grantee.java
++*** hsqldb-old/src/org/hsqldb/Grantee.java	2006-04-11 17:13:22.000000000 +0200
++--- hsqldb/src/org/hsqldb/Grantee.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 52,60 ****
++   * Method names ending in Direct indicate methods which do not recurse
++   * to look through Roles which "this" object is a member of.
++   *
++!  * We use the word "Admin" (e.g., in private variable "admin" and method
++   * "isAdmin()) to mean this Grantee has admin priv by any means.
++!  * We use the word "adminDirect" (e.g., in private variable "adminDirect"
++   * and method "isAdminDirect()) to mean this Grantee has admin priv
++   * directly.
++   *
++--- 52,60 ----
++   * Method names ending in Direct indicate methods which do not recurse
++   * to look through Roles which "this" object is a member of.
++   *
++!  * We use the word "Admin" (e.g., in public variable "admin" and method
++   * "isAdmin()) to mean this Grantee has admin priv by any means.
++!  * We use the word "adminDirect" (e.g., in public variable "adminDirect"
++   * and method "isAdminDirect()) to mean this Grantee has admin priv
++   * directly.
++   *
++***************
++*** 73,93 ****
++       * true if this grantee has database administrator priv directly
++       *  (ie., not by membership in any role)
++       */
++!     private boolean isAdminDirect = false;
++  
++      /** true if this grantee has database administrator priv by any means. */
++!     private boolean isAdmin = false;
++  
++      /** contains righs granted direct, or via roles, expept those of PUBLIC */
++!     private IntValueHashMap fullRightsMap = new IntValueHashMap();
++  
++      /**
++       * Grantee name.
++       */
++!     private String granteeName;
++  
++      /** map with database object identifier keys and access privileges values */
++!     private IntValueHashMap rightsMap;
++  
++      /** These are the DIRECT roles.  Each of these may contain nested roles */
++      HashSet roles = new HashSet();
++--- 73,93 ----
++       * true if this grantee has database administrator priv directly
++       *  (ie., not by membership in any role)
++       */
++!     public boolean isAdminDirect = false;
++  
++      /** true if this grantee has database administrator priv by any means. */
++!     public boolean isAdmin = false;
++  
++      /** contains righs granted direct, or via roles, expept those of PUBLIC */
++!     public IntValueHashMap fullRightsMap = new IntValueHashMap();
++  
++      /**
++       * Grantee name.
++       */
++!     public String granteeName;
++  
++      /** map with database object identifier keys and access privileges values */
++!     public IntValueHashMap rightsMap;
++  
++      /** These are the DIRECT roles.  Each of these may contain nested roles */
++      HashSet roles = new HashSet();
++***************
++*** 98,107 ****
++       * Note: All Grantee objects except the special
++       * SYS and PUBLIC Grantee objects contain a reference to this object
++       */
++!     private Grantee pubGrantee;
++  
++      /** Needed only to give access to the roles for this database */
++!     private GranteeManager granteeManager;
++  
++      /**
++       * Constructor, with a argument reference to the PUBLIC User Object which
++--- 98,107 ----
++       * Note: All Grantee objects except the special
++       * SYS and PUBLIC Grantee objects contain a reference to this object
++       */
++!     public Grantee pubGrantee;
++  
++      /** Needed only to give access to the roles for this database */
++!     public GranteeManager granteeManager;
++  
++      /**
++       * Constructor, with a argument reference to the PUBLIC User Object which
++***************
++*** 219,225 ****
++       *
++       * @return Given role with new elements added.
++       */
++!     private HashSet addGranteeAndRoles(HashSet set) {
++  
++          String candidateRole;
++  
++--- 219,225 ----
++       *
++       * @return Given role with new elements added.
++       */
++!     public HashSet addGranteeAndRoles(HashSet set) {
++  
++          String candidateRole;
++  
++***************
++*** 431,437 ****
++       * Considers none of pubGranee, nested roles, admin privs, globally
++       * available Class object.
++       */
++!     protected boolean isDirectlyAccessible(Object dbObject,
++                                             int rights) throws HsqlException {
++  
++          int n = rightsMap.get(dbObject, 0);
++--- 431,437 ----
++       * Considers none of pubGranee, nested roles, admin privs, globally
++       * available Class object.
++       */
++!     public boolean isDirectlyAccessible(Object dbObject,
++                                             int rights) throws HsqlException {
++  
++          int n = rightsMap.get(dbObject, 0);
++diff -crN hsqldb-old/src/org/hsqldb/GranteeManager.java hsqldb/src/org/hsqldb/GranteeManager.java
++*** hsqldb-old/src/org/hsqldb/GranteeManager.java	2005-10-29 20:49:36.000000000 +0200
++--- hsqldb/src/org/hsqldb/GranteeManager.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 105,117 ****
++       * Map of String-to-Grantee-objects.<p>
++       * Primary object maintained by this class
++       */
++!     private HashMappedList map = new HashMappedList();
++  
++      /**
++       * This object's set of Role objects. <p>
++       * role-Strings-to-Grantee-object
++       */
++!     private HashMappedList roleMap = new HashMappedList();
++  
++      /**
++       * Construct the GranteeManager for a Database.
++--- 105,117 ----
++       * Map of String-to-Grantee-objects.<p>
++       * Primary object maintained by this class
++       */
++!     public HashMappedList map = new HashMappedList();
++  
++      /**
++       * This object's set of Role objects. <p>
++       * role-Strings-to-Grantee-object
++       */
++!     public HashMappedList roleMap = new HashMappedList();
++  
++      /**
++       * Construct the GranteeManager for a Database.
++***************
++*** 451,457 ****
++          return list;
++      }
++  
++!     private static String[] getRightsArraySub(int right) {
++  
++  //        checkValidFlags(right);
++          if (right == 0) {
++--- 451,457 ----
++          return list;
++      }
++  
++!     public static String[] getRightsArraySub(int right) {
++  
++  //        checkValidFlags(right);
++          if (right == 0) {
++diff -crN hsqldb-old/src/org/hsqldb/GroupedResult.java hsqldb/src/org/hsqldb/GroupedResult.java
++*** hsqldb-old/src/org/hsqldb/GroupedResult.java	2005-10-23 21:25:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/GroupedResult.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 68,80 ****
++  class GroupedResult {
++  
++  /** @todo fredt - initialise results on first use */
++!     private Result        result;
++      int                   groupBegin;
++      int                   groupEnd;
++!     private final boolean isGrouped;
++!     private final boolean isAggregated;
++!     private HashSet       groups;
++!     private ResultGroup   currGroup;
++  
++      GroupedResult(Select select, Result.ResultMetaData meta) {
++  
++--- 68,80 ----
++  class GroupedResult {
++  
++  /** @todo fredt - initialise results on first use */
++!     public Result        result;
++      int                   groupBegin;
++      int                   groupEnd;
++!     public final boolean isGrouped;
++!     public final boolean isAggregated;
++!     public HashSet       groups;
++!     public ResultGroup   currGroup;
++  
++      GroupedResult(Select select, Result.ResultMetaData meta) {
++  
++***************
++*** 152,158 ****
++          Object[] row;
++          int      hashCode;
++  
++!         private ResultGroup(Object[] row) {
++  
++              this.row = row;
++              hashCode = 0;
++--- 152,158 ----
++          Object[] row;
++          int      hashCode;
++  
++!         public ResultGroup(Object[] row) {
++  
++              this.row = row;
++              hashCode = 0;
++***************
++*** 189,195 ****
++              return true;
++          }
++  
++!         private boolean equals(Object o1, Object o2) {
++              return (o1 == null) ? o2 == null
++                                  : o1.equals(o2);
++          }
++--- 189,195 ----
++              return true;
++          }
++  
++!         public boolean equals(Object o1, Object o2) {
++              return (o1 == null) ? o2 == null
++                                  : o1.equals(o2);
++          }
++diff -crN hsqldb-old/src/org/hsqldb/HSQLClientConnection.java hsqldb/src/org/hsqldb/HSQLClientConnection.java
++*** hsqldb-old/src/org/hsqldb/HSQLClientConnection.java	2006-09-24 17:37:58.000000000 +0200
++--- hsqldb/src/org/hsqldb/HSQLClientConnection.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 56,73 ****
++  
++      static final int          BUFFER_SIZE = 0x1000;
++      final byte[]              mainBuffer  = new byte[BUFFER_SIZE];
++!     private boolean           isClosed;
++!     private Socket            socket;
++!     protected OutputStream    dataOutput;
++!     protected DataInputStream dataInput;
++!     protected RowOutputBinary rowOut;
++!     protected RowInputBinary  rowIn;
++!     private Result            resultOut;
++!     private int               sessionID;
++  
++      //
++!     private boolean isReadOnly   = false;
++!     private boolean isAutoCommit = true;
++  
++      //
++      String  host;
++--- 56,73 ----
++  
++      static final int          BUFFER_SIZE = 0x1000;
++      final byte[]              mainBuffer  = new byte[BUFFER_SIZE];
++!     public boolean           isClosed;
++!     public Socket            socket;
++!     public OutputStream    dataOutput;
++!     public DataInputStream dataInput;
++!     public RowOutputBinary rowOut;
++!     public RowInputBinary  rowIn;
++!     public Result            resultOut;
++!     public int               sessionID;
++  
++      //
++!     public boolean isReadOnly   = false;
++!     public boolean isAutoCommit = true;
++  
++      //
++      String  host;
++***************
++*** 113,119 ****
++       * resultOut is reused to trasmit all remote calls for session management.
++       * Here the structure is preset for sending attributes.
++       */
++!     private void initStructures() {
++  
++          rowOut    = new RowOutputBinary(mainBuffer);
++          rowIn     = new RowInputBinary(rowOut);
++--- 113,119 ----
++       * resultOut is reused to trasmit all remote calls for session management.
++       * Here the structure is preset for sending attributes.
++       */
++!     public void initStructures() {
++  
++          rowOut    = new RowOutputBinary(mainBuffer);
++          rowIn     = new RowInputBinary(rowOut);
++***************
++*** 122,133 ****
++          resultOut.add(new Object[7]);
++      }
++  
++!     protected void initConnection(String host, int port,
++                                    boolean isTLS) throws HsqlException {
++          openConnection(host, port, isTLS);
++      }
++  
++!     protected void openConnection(String host, int port,
++                                    boolean isTLS) throws HsqlException {
++  
++          try {
++--- 122,133 ----
++          resultOut.add(new Object[7]);
++      }
++  
++!     public void initConnection(String host, int port,
++                                    boolean isTLS) throws HsqlException {
++          openConnection(host, port, isTLS);
++      }
++  
++!     public void openConnection(String host, int port,
++                                    boolean isTLS) throws HsqlException {
++  
++          try {
++***************
++*** 143,149 ****
++          }
++      }
++  
++!     protected void closeConnection() {
++  
++          try {
++              if (socket != null) {
++--- 143,149 ----
++          }
++      }
++  
++!     public void closeConnection() {
++  
++          try {
++              if (socket != null) {
++***************
++*** 186,192 ****
++          } catch (Exception e) {}
++      }
++  
++!     private Object getAttribute(int id) throws HsqlException {
++  
++          resultOut.setResultType(ResultConstants.GETSESSIONATTR);
++  
++--- 186,192 ----
++          } catch (Exception e) {}
++      }
++  
++!     public Object getAttribute(int id) throws HsqlException {
++  
++          resultOut.setResultType(ResultConstants.GETSESSIONATTR);
++  
++***************
++*** 199,205 ****
++          return in.rRoot.data[id];
++      }
++  
++!     private void setAttribute(Object property, int id) throws HsqlException {
++  
++          resultOut.setResultType(ResultConstants.SETSESSIONATTR);
++          ArrayUtil.fillArray(resultOut.rRoot.data, null);
++--- 199,205 ----
++          return in.rRoot.data[id];
++      }
++  
++!     public void setAttribute(Object property, int id) throws HsqlException {
++  
++          resultOut.setResultType(ResultConstants.SETSESSIONATTR);
++          ArrayUtil.fillArray(resultOut.rRoot.data, null);
++***************
++*** 335,345 ****
++          databaseID = resultIn.databaseID;
++      }
++  
++!     protected void write(Result r) throws IOException, HsqlException {
++          Result.write(r, rowOut, dataOutput);
++      }
++  
++!     protected Result read() throws IOException, HsqlException {
++  
++          Result r = Result.read(rowIn, dataInput);
++  
++--- 335,345 ----
++          databaseID = resultIn.databaseID;
++      }
++  
++!     public void write(Result r) throws IOException, HsqlException {
++          Result.write(r, rowOut, dataOutput);
++      }
++  
++!     public Result read() throws IOException, HsqlException {
++  
++          Result r = Result.read(rowIn, dataInput);
++  
++diff -crN hsqldb-old/src/org/hsqldb/HsqlDateTime.java hsqldb/src/org/hsqldb/HsqlDateTime.java
++*** hsqldb-old/src/org/hsqldb/HsqlDateTime.java	2006-07-10 13:28:32.000000000 +0200
++--- hsqldb/src/org/hsqldb/HsqlDateTime.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 74,86 ****
++       * A reusable static value for today's date. Should only be accessed
++       * by getToday()
++       */
++!     private static Calendar today          = new GregorianCalendar();
++!     private static Calendar tempCal        = new GregorianCalendar();
++!     private static Calendar tempCalDefault = new GregorianCalendar();
++!     private static Calendar tempCalGMT =
++          new GregorianCalendar(TimeZone.getTimeZone("GMT"));
++!     private static Date tempDate = new Date(0);
++!     private static Date currentDate;
++  
++      static {
++          resetToday(System.currentTimeMillis());
++--- 74,86 ----
++       * A reusable static value for today's date. Should only be accessed
++       * by getToday()
++       */
++!     public static Calendar today          = new GregorianCalendar();
++!     public static Calendar tempCal        = new GregorianCalendar();
++!     public static Calendar tempCalDefault = new GregorianCalendar();
++!     public static Calendar tempCalGMT =
++          new GregorianCalendar(TimeZone.getTimeZone("GMT"));
++!     public static Date tempDate = new Date(0);
++!     public static Date currentDate;
++  
++      static {
++          resetToday(System.currentTimeMillis());
++***************
++*** 231,240 ****
++          return new Timestamp(millis);
++      }
++  
++!     private static final String sdftPattern     = "HH:mm:ss";
++!     private static final String sdfdPattern     = "yyyy-MM-dd";
++!     private static final String sdftsPattern    = "yyyy-MM-dd HH:mm:ss.";
++!     private static final String sdftsSysPattern = "yyyy-MM-dd HH:mm:ss.SSS";
++      static SimpleDateFormat     sdfd = new SimpleDateFormat(sdfdPattern);
++      static SimpleDateFormat     sdft = new SimpleDateFormat(sdftPattern);
++      static SimpleDateFormat     sdfts = new SimpleDateFormat(sdftsPattern);
++--- 231,240 ----
++          return new Timestamp(millis);
++      }
++  
++!     public static final String sdftPattern     = "HH:mm:ss";
++!     public static final String sdfdPattern     = "yyyy-MM-dd";
++!     public static final String sdftsPattern    = "yyyy-MM-dd HH:mm:ss.";
++!     public static final String sdftsSysPattern = "yyyy-MM-dd HH:mm:ss.SSS";
++      static SimpleDateFormat     sdfd = new SimpleDateFormat(sdfdPattern);
++      static SimpleDateFormat     sdft = new SimpleDateFormat(sdftPattern);
++      static SimpleDateFormat     sdfts = new SimpleDateFormat(sdftsPattern);
++***************
++*** 270,276 ****
++          }
++      }
++  
++!     private static java.util.Date sysDate = new java.util.Date();
++  
++      public static String getSytemTimeString() {
++  
++--- 270,276 ----
++          }
++      }
++  
++!     public static java.util.Date sysDate = new java.util.Date();
++  
++      public static String getSytemTimeString() {
++  
++***************
++*** 342,348 ****
++      /**
++       * resets the static reusable value today
++       */
++!     private static synchronized void resetToday(long millis) {
++  
++  //#ifdef JDBC3
++          // Use method directly
++--- 342,348 ----
++      /**
++       * resets the static reusable value today
++       */
++!     public static synchronized void resetToday(long millis) {
++  
++  //#ifdef JDBC3
++          // Use method directly
++***************
++*** 363,374 ****
++  
++      /**
++       * Sets the time in the given Calendar using the given milliseconds value; wrapper method to
++!      * allow use of more efficient JDK1.4 method on JDK1.4 (was protected in earlier versions).
++       *
++       * @param       cal                             the Calendar
++       * @param       millis                  the time value in milliseconds
++       */
++!     private static void setTimeInMillis(Calendar cal, long millis) {
++  
++  //#ifdef JDBC3
++          // Use method directly
++--- 363,374 ----
++  
++      /**
++       * Sets the time in the given Calendar using the given milliseconds value; wrapper method to
++!      * allow use of more efficient JDK1.4 method on JDK1.4 (was public in earlier versions).
++       *
++       * @param       cal                             the Calendar
++       * @param       millis                  the time value in milliseconds
++       */
++!     public static void setTimeInMillis(Calendar cal, long millis) {
++  
++  //#ifdef JDBC3
++          // Use method directly
++***************
++*** 408,414 ****
++  
++      /**
++       * Gets the time from the given Calendar as a milliseconds value; wrapper method to
++!      * allow use of more efficient JDK1.4 method on JDK1.4 (was protected in earlier versions).
++       *
++       * @param       cal                             the Calendar
++       * @return      the time value in milliseconds
++--- 408,414 ----
++  
++      /**
++       * Gets the time from the given Calendar as a milliseconds value; wrapper method to
++!      * allow use of more efficient JDK1.4 method on JDK1.4 (was public in earlier versions).
++       *
++       * @param       cal                             the Calendar
++       * @return      the time value in milliseconds
++***************
++*** 519,525 ****
++          }
++      }
++  
++!     private static final char[][] dateTokens     = {
++          {
++              'R', 'R', 'R', 'R'
++          }, {
++--- 519,525 ----
++          }
++      }
++  
++!     public static final char[][] dateTokens     = {
++          {
++              'R', 'R', 'R', 'R'
++          }, {
++***************
++*** 568,574 ****
++              'P', '.', 'M', '.'
++          }
++      };
++!     private static final String[] javaDateTokens = {
++          "yyyy", "yyyy", "yyyy", "yy", "yy", "G", "G", "G", "G", "MMM",
++          "MMMMM", "E", "w", "dd", "D", "k", "K", "K", "mm", "ss", "aaa", "aaa",
++          "aaa", "aaa"
++--- 568,574 ----
++              'P', '.', 'M', '.'
++          }
++      };
++!     public static final String[] javaDateTokens = {
++          "yyyy", "yyyy", "yyyy", "yy", "yy", "G", "G", "G", "G", "MMM",
++          "MMMMM", "E", "w", "dd", "D", "k", "K", "K", "mm", "ss", "aaa", "aaa",
++          "aaa", "aaa"
++***************
++*** 621,630 ****
++       */
++      static class Tokenizer {
++  
++!         private int     last;
++!         private int     offset;
++!         private long    state;
++!         private boolean consumed;
++  
++          public Tokenizer() {
++              reset();
++--- 621,630 ----
++       */
++      static class Tokenizer {
++  
++!         public int     last;
++!         public int     offset;
++!         public long    state;
++!         public boolean consumed;
++  
++          public Tokenizer() {
++              reset();
++***************
++*** 670,676 ****
++           * @param bit
++           * @return
++           */
++!         private boolean isZeroBit(int bit) {
++              return (state & (1L << bit)) == 0;
++          }
++  
++--- 670,676 ----
++           * @param bit
++           * @return
++           */
++!         public boolean isZeroBit(int bit) {
++              return (state & (1L << bit)) == 0;
++          }
++  
++***************
++*** 678,684 ****
++           * Sets the specified bit.
++           * @param bit
++           */
++!         private void setBit(int bit) {
++              state |= (1L << bit);
++          }
++  
++--- 678,684 ----
++           * Sets the specified bit.
++           * @param bit
++           */
++!         public void setBit(int bit) {
++              state |= (1L << bit);
++          }
++  
++diff -crN hsqldb-old/src/org/hsqldb/HsqlException.java hsqldb/src/org/hsqldb/HsqlException.java
++*** hsqldb-old/src/org/hsqldb/HsqlException.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/HsqlException.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 42,50 ****
++   */
++  public class HsqlException extends Exception {
++  
++!     private String message;
++!     private String state;
++!     private int    code;
++  
++      /**
++       * @param message String
++--- 42,50 ----
++   */
++  public class HsqlException extends Exception {
++  
++!     public String message;
++!     public String state;
++!     public int    code;
++  
++      /**
++       * @param message String
++diff -crN hsqldb-old/src/org/hsqldb/HsqlNameManager.java hsqldb/src/org/hsqldb/HsqlNameManager.java
++*** hsqldb-old/src/org/hsqldb/HsqlNameManager.java	2007-07-23 20:30:48.000000000 +0200
++--- hsqldb/src/org/hsqldb/HsqlNameManager.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 61,74 ****
++   */
++  public class HsqlNameManager {
++  
++!     private static HsqlNameManager staticManager = new HsqlNameManager();
++  
++      static {
++          staticManager.serialNumber = Integer.MIN_VALUE;
++      }
++  
++!     private int serialNumber = 1;    // 0 is reserved in lookups
++!     private int sysNumber    = 0;
++  
++      static HsqlName newHsqlSystemObjectName(String name) {
++          return new HsqlName(staticManager, name);
++--- 61,74 ----
++   */
++  public class HsqlNameManager {
++  
++!     public static HsqlNameManager staticManager = new HsqlNameManager();
++  
++      static {
++          staticManager.serialNumber = Integer.MIN_VALUE;
++      }
++  
++!     public int serialNumber = 1;    // 0 is reserved in lookups
++!     public int sysNumber    = 0;
++  
++      static HsqlName newHsqlSystemObjectName(String name) {
++          return new HsqlName(staticManager, name);
++***************
++*** 133,153 ****
++          boolean           isNameQuoted;
++          public String     statementName;
++          public HsqlName   schema;
++!         private final int hashCode;
++  
++!         private HsqlName(HsqlNameManager man) {
++              manager  = man;
++              hashCode = manager.serialNumber++;
++          }
++  
++!         private HsqlName(HsqlNameManager man, String name, boolean isquoted) {
++  
++              this(man);
++  
++              rename(name, isquoted);
++          }
++  
++!         private HsqlName(HsqlNameManager man, String prefix, String name,
++                           boolean isquoted) {
++  
++              this(man);
++--- 133,153 ----
++          boolean           isNameQuoted;
++          public String     statementName;
++          public HsqlName   schema;
++!         public final int hashCode;
++  
++!         public HsqlName(HsqlNameManager man) {
++              manager  = man;
++              hashCode = manager.serialNumber++;
++          }
++  
++!         public HsqlName(HsqlNameManager man, String name, boolean isquoted) {
++  
++              this(man);
++  
++              rename(name, isquoted);
++          }
++  
++!         public HsqlName(HsqlNameManager man, String prefix, String name,
++                           boolean isquoted) {
++  
++              this(man);
++***************
++*** 155,161 ****
++              rename(prefix, name, isquoted);
++          }
++  
++!         private HsqlName(HsqlNameManager man, String name) {
++  
++              this(man);
++  
++--- 155,161 ----
++              rename(prefix, name, isquoted);
++          }
++  
++!         public HsqlName(HsqlNameManager man, String name) {
++  
++              this(man);
++  
++diff -crN hsqldb-old/src/org/hsqldb/HsqlServerFactory.java hsqldb/src/org/hsqldb/HsqlServerFactory.java
++*** hsqldb-old/src/org/hsqldb/HsqlServerFactory.java	2007-06-11 12:12:28.000000000 +0200
++--- hsqldb/src/org/hsqldb/HsqlServerFactory.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 49,55 ****
++   */
++  public class HsqlServerFactory {
++  
++!     private HsqlServerFactory() {}
++  
++      public static HsqlSocketRequestHandler createHsqlServer(String dbFilePath,
++              boolean debugMessages, boolean silentMode) throws SQLException {
++--- 49,55 ----
++   */
++  public class HsqlServerFactory {
++  
++!     public HsqlServerFactory() {}
++  
++      public static HsqlSocketRequestHandler createHsqlServer(String dbFilePath,
++              boolean debugMessages, boolean silentMode) throws SQLException {
++diff -crN hsqldb-old/src/org/hsqldb/HsqlSocketFactory.java hsqldb/src/org/hsqldb/HsqlSocketFactory.java
++*** hsqldb-old/src/org/hsqldb/HsqlSocketFactory.java	2005-10-23 21:25:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/HsqlSocketFactory.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 48,55 ****
++  public class HsqlSocketFactory {
++  
++  // ----------------------------- static members ---------------------------------
++!     private static HsqlSocketFactory plainImpl;
++!     private static HsqlSocketFactory sslImpl;
++  
++  // ------------------------------ constructors ---------------------------------
++  
++--- 48,55 ----
++  public class HsqlSocketFactory {
++  
++  // ----------------------------- static members ---------------------------------
++!     public static HsqlSocketFactory plainImpl;
++!     public static HsqlSocketFactory sslImpl;
++  
++  // ------------------------------ constructors ---------------------------------
++  
++***************
++*** 57,63 ****
++       * External construction disabled.  New factory instances are retreived
++       * through the newHsqlSocketFactory method instead.
++       */
++!     protected HsqlSocketFactory() throws Exception {}
++  
++  // ------------------------- factory builder method ----------------------------
++  
++--- 57,63 ----
++       * External construction disabled.  New factory instances are retreived
++       * through the newHsqlSocketFactory method instead.
++       */
++!     public HsqlSocketFactory() throws Exception {}
++  
++  // ------------------------- factory builder method ----------------------------
++  
++***************
++*** 133,139 ****
++      }
++  
++  // ------------------------ static utility methods -----------------------------
++!     private static HsqlSocketFactory getPlainImpl() throws Exception {
++  
++          synchronized (HsqlSocketFactory.class) {
++              if (plainImpl == null) {
++--- 133,139 ----
++      }
++  
++  // ------------------------ static utility methods -----------------------------
++!     public static HsqlSocketFactory getPlainImpl() throws Exception {
++  
++          synchronized (HsqlSocketFactory.class) {
++              if (plainImpl == null) {
++***************
++*** 144,150 ****
++          return plainImpl;
++      }
++  
++!     private static HsqlSocketFactory getSSLImpl() throws Exception {
++  
++          synchronized (HsqlSocketFactory.class) {
++              if (sslImpl == null) {
++--- 144,150 ----
++          return plainImpl;
++      }
++  
++!     public static HsqlSocketFactory getSSLImpl() throws Exception {
++  
++          synchronized (HsqlSocketFactory.class) {
++              if (sslImpl == null) {
++***************
++*** 170,176 ****
++       * @throws Exception if a new secure socket factory cannot
++       *      be constructed
++       */
++!     private static HsqlSocketFactory newFactory(String implClass)
++      throws Exception {
++  
++          Class       clazz;
++--- 170,176 ----
++       * @throws Exception if a new secure socket factory cannot
++       *      be constructed
++       */
++!     public static HsqlSocketFactory newFactory(String implClass)
++      throws Exception {
++  
++          Class       clazz;
++***************
++*** 182,188 ****
++          clazz    = Class.forName(implClass);
++          ctorParm = new Class[0];
++  
++!         // protected constructor
++          ctor    = clazz.getDeclaredConstructor(ctorParm);
++          ctorArg = new Object[0];
++  
++--- 182,188 ----
++          clazz    = Class.forName(implClass);
++          ctorParm = new Class[0];
++  
++!         // public constructor
++          ctor    = clazz.getDeclaredConstructor(ctorParm);
++          ctorArg = new Object[0];
++  
++diff -crN hsqldb-old/src/org/hsqldb/HsqlSocketFactorySecure.java hsqldb/src/org/hsqldb/HsqlSocketFactorySecure.java
++*** hsqldb-old/src/org/hsqldb/HsqlSocketFactorySecure.java	2005-10-23 21:25:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/HsqlSocketFactorySecure.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 65,86 ****
++  // --------------------------------- members -----------------------------------
++  
++      /** The underlying socket factory implementation. */
++!     protected Object socketFactory;
++  
++      /** The underlying server socket factory implementation. */
++!     protected Object serverSocketFactory;
++  
++      /**
++       * Monitor object to guard against conncurrent modification
++       * of the underlying socket factory implementation member.
++       */
++!     protected final Object socket_factory_mutex = new Object();
++  
++      /**
++       * Monitor object to guard against concurrent modification of
++       * the underlying server socket factory implementation member.
++       */
++!     protected final Object server_socket_factory_mutex = new Object();
++  
++  // ------------------------------ constructors ---------------------------------
++  
++--- 65,86 ----
++  // --------------------------------- members -----------------------------------
++  
++      /** The underlying socket factory implementation. */
++!     public Object socketFactory;
++  
++      /** The underlying server socket factory implementation. */
++!     public Object serverSocketFactory;
++  
++      /**
++       * Monitor object to guard against conncurrent modification
++       * of the underlying socket factory implementation member.
++       */
++!     public final Object socket_factory_mutex = new Object();
++  
++      /**
++       * Monitor object to guard against concurrent modification of
++       * the underlying server socket factory implementation member.
++       */
++!     public final Object server_socket_factory_mutex = new Object();
++  
++  // ------------------------------ constructors ---------------------------------
++  
++***************
++*** 88,94 ****
++       * External construction disabled.  New factory instances are retreived
++       * through the newHsqlSocketFactory method instead.
++       */
++!     protected HsqlSocketFactorySecure() throws Exception {
++  
++          super();
++  
++--- 88,94 ----
++       * External construction disabled.  New factory instances are retreived
++       * through the newHsqlSocketFactory method instead.
++       */
++!     public HsqlSocketFactorySecure() throws Exception {
++  
++          super();
++  
++***************
++*** 174,180 ****
++          return ss;
++      }
++  
++!     private static void dump(String title, String[] as) {
++  
++          Trace.printSystemOut(title);
++          Trace.printSystemOut("----------------------------");
++--- 174,180 ----
++          return ss;
++      }
++  
++!     public static void dump(String title, String[] as) {
++  
++          Trace.printSystemOut(title);
++          Trace.printSystemOut("----------------------------");
++***************
++*** 263,269 ****
++       *      underlying factory
++       * @return the underlying javax.net.ssl.SSLServerSocketFactory
++       */
++!     protected SSLServerSocketFactory getServerSocketFactoryImpl()
++      throws Exception {
++  
++          Object factory;
++--- 263,269 ----
++       *      underlying factory
++       * @return the underlying javax.net.ssl.SSLServerSocketFactory
++       */
++!     public SSLServerSocketFactory getServerSocketFactoryImpl()
++      throws Exception {
++  
++          Object factory;
++***************
++*** 287,293 ****
++       *      underlying factory
++       * @return the underlying javax.net.ssl.SSLSocketFactory
++       */
++!     protected SSLSocketFactory getSocketFactoryImpl() throws Exception {
++  
++          Object factory;
++  
++--- 287,293 ----
++       *      underlying factory
++       * @return the underlying javax.net.ssl.SSLSocketFactory
++       */
++!     public SSLSocketFactory getSocketFactoryImpl() throws Exception {
++  
++          Object factory;
++  
++***************
++*** 313,319 ****
++       * @param session SSLSession used on the connection to host
++       * @throws Exception if the certificate chain cannot be verified
++       */
++!     protected void verify(String host, SSLSession session) throws Exception {
++  
++          X509Certificate[] chain;
++          X509Certificate   certificate;
++--- 313,319 ----
++       * @param session SSLSession used on the connection to host
++       * @throws Exception if the certificate chain cannot be verified
++       */
++!     public void verify(String host, SSLSession session) throws Exception {
++  
++          X509Certificate[] chain;
++          X509Certificate   certificate;
++diff -crN hsqldb-old/src/org/hsqldb/HTTPClientConnection.java hsqldb/src/org/hsqldb/HTTPClientConnection.java
++*** hsqldb-old/src/org/hsqldb/HTTPClientConnection.java	2005-10-23 21:25:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/HTTPClientConnection.java	2007-11-04 00:13:48.000000000 +0100
++***************
++*** 53,59 ****
++          super(host, port, path, database, isTLS, user, password);
++      }
++  
++!     protected void initConnection(String host, int port,
++                                    boolean isTLS) throws HsqlException {}
++  
++      public synchronized Result execute(Result r) throws HsqlException {
++--- 53,59 ----
++          super(host, port, path, database, isTLS, user, password);
++      }
++  
++!     public void initConnection(String host, int port,
++                                    boolean isTLS) throws HsqlException {}
++  
++      public synchronized Result execute(Result r) throws HsqlException {
++***************
++*** 67,73 ****
++          return result;
++      }
++  
++!     protected void write(Result r) throws IOException, HsqlException {
++  
++          rowOut.reset();
++          r.write(rowOut);
++--- 67,73 ----
++          return result;
++      }
++  
++!     public void write(Result r) throws IOException, HsqlException {
++  
++          rowOut.reset();
++          r.write(rowOut);
++***************
++*** 84,90 ****
++          dataOutput.flush();
++      }
++  
++!     protected Result read() throws IOException, HsqlException {
++  
++          // fredt - for WebServer 4 lines should be skipped
++          // for Servlet, number of lines depends on Servlet container
++--- 84,90 ----
++          dataOutput.flush();
++      }
++  
++!     public Result read() throws IOException, HsqlException {
++  
++          // fredt - for WebServer 4 lines should be skipped
++          // for Servlet, number of lines depends on Servlet container
++diff -crN hsqldb-old/src/org/hsqldb/Index.java hsqldb/src/org/hsqldb/Index.java
++*** hsqldb-old/src/org/hsqldb/Index.java	2006-08-06 00:19:32.000000000 +0200
++--- hsqldb/src/org/hsqldb/Index.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 98,116 ****
++      static final int POINTER_INDEX = 2;
++  
++      // fields
++!     private final HsqlName indexName;
++      final boolean[]        colCheck;
++!     private final int[]    colIndex;
++!     private final int[]    colTypes;
++      final int[]            pkCols;
++      final int[]            pkTypes;
++!     private final boolean  isUnique;    // DDL uniqueness
++!     private final boolean  useRowId;
++      final boolean          isConstraint;
++      final boolean          isForward;
++      final boolean          isTemp;
++!     private Node           root;
++!     private int            depth;
++      final Collation        collation;
++      static IndexRowIterator emptyIterator = new IndexRowIterator(null, null,
++          null);
++--- 98,116 ----
++      static final int POINTER_INDEX = 2;
++  
++      // fields
++!     public final HsqlName indexName;
++      final boolean[]        colCheck;
++!     public final int[]    colIndex;
++!     public final int[]    colTypes;
++      final int[]            pkCols;
++      final int[]            pkTypes;
++!     public final boolean  isUnique;    // DDL uniqueness
++!     public final boolean  useRowId;
++      final boolean          isConstraint;
++      final boolean          isForward;
++      final boolean          isTemp;
++!     public Node           root;
++!     public int            depth;
++      final Collation        collation;
++      static IndexRowIterator emptyIterator = new IndexRowIterator(null, null,
++          null);
++***************
++*** 280,286 ****
++                                : root.getKey();
++      }
++  
++!     private Node getRoot(Session session) {
++  
++          if (isTemp && session != null) {
++              return session.getIndexRoot(indexName, onCommitPreserve);
++--- 280,286 ----
++                                : root.getKey();
++      }
++  
++!     public Node getRoot(Session session) {
++  
++          if (isTemp && session != null) {
++              return session.getIndexRoot(indexName, onCommitPreserve);
++***************
++*** 344,350 ****
++      /**
++       * Balances part of the tree after an alteration to the index.
++       */
++!     private void balance(Session session, Node x,
++                           boolean isleft) throws HsqlException {
++  
++          while (true) {
++--- 344,350 ----
++      /**
++       * Balances part of the tree after an alteration to the index.
++       */
++!     public void balance(Session session, Node x,
++                           boolean isleft) throws HsqlException {
++  
++          while (true) {
++***************
++*** 693,699 ****
++       * @return matching node or null
++       * @throws HsqlException
++       */
++!     private Node findNotNull(Session session, Object[] rowdata,
++                               int[] rowColMap,
++                               boolean first) throws HsqlException {
++  
++--- 693,699 ----
++       * @return matching node or null
++       * @throws HsqlException
++       */
++!     public Node findNotNull(Session session, Object[] rowdata,
++                               int[] rowColMap,
++                               boolean first) throws HsqlException {
++  
++***************
++*** 1077,1083 ****
++       *
++       * @throws HsqlException
++       */
++!     private Node child(Node x, boolean isleft) throws HsqlException {
++          return isleft ? x.getLeft()
++                        : x.getRight();
++      }
++--- 1077,1083 ----
++       *
++       * @throws HsqlException
++       */
++!     public Node child(Node x, boolean isleft) throws HsqlException {
++          return isleft ? x.getLeft()
++                        : x.getRight();
++      }
++***************
++*** 1090,1096 ****
++       *
++       * @throws HsqlException
++       */
++!     private void replace(Session session, Node x,
++                           Node n) throws HsqlException {
++  
++          if (x.isRoot()) {
++--- 1090,1096 ----
++       *
++       * @throws HsqlException
++       */
++!     public void replace(Session session, Node x,
++                           Node n) throws HsqlException {
++  
++          if (x.isRoot()) {
++***************
++*** 1115,1121 ****
++       *
++       * @throws HsqlException
++       */
++!     private void set(Node x, boolean isleft, Node n) throws HsqlException {
++  
++          x = x.getUpdatedNode();
++  
++--- 1115,1121 ----
++       *
++       * @throws HsqlException
++       */
++!     public void set(Node x, boolean isleft, Node n) throws HsqlException {
++  
++          x = x.getUpdatedNode();
++  
++***************
++*** 1141,1147 ****
++       *
++       * @throws HsqlException
++       */
++!     private Node search(Session session, Row row) throws HsqlException {
++  
++          Object[] d = row.getData();
++          Node     x = getRoot(session);
++--- 1141,1147 ----
++       *
++       * @throws HsqlException
++       */
++!     public Node search(Session session, Row row) throws HsqlException {
++  
++          Object[] d = row.getData();
++          Node     x = getRoot(session);
++***************
++*** 1235,1241 ****
++       *
++       * @throws HsqlException
++       */
++!     private int compareRowForInsert(Session session, Row newRow,
++                                      Row existingRow) throws HsqlException {
++  
++          Object[] a       = newRow.getData();
++--- 1235,1241 ----
++       *
++       * @throws HsqlException
++       */
++!     public int compareRowForInsert(Session session, Row newRow,
++                                      Row existingRow) throws HsqlException {
++  
++          Object[] a       = newRow.getData();
++***************
++*** 1317,1323 ****
++          }
++      }
++  
++!     private IndexRowIterator getIterator(Session session, Node x) {
++  
++          if (x == null) {
++              return emptyIterator;
++--- 1317,1323 ----
++          }
++      }
++  
++!     public IndexRowIterator getIterator(Session session, Node x) {
++  
++          if (x == null) {
++              return emptyIterator;
++***************
++*** 1333,1345 ****
++          Session                    session;
++          Index                      index;
++          Node                       nextnode;
++!         protected IndexRowIterator last;
++!         protected IndexRowIterator next;
++  
++          /**
++           * When session == null, rows from all sessions are returned
++           */
++!         private IndexRowIterator(Session session, Index index, Node node) {
++  
++              if (index == null) {
++                  return;
++--- 1333,1345 ----
++          Session                    session;
++          Index                      index;
++          Node                       nextnode;
++!         public IndexRowIterator last;
++!         public IndexRowIterator next;
++  
++          /**
++           * When session == null, rows from all sessions are returned
++           */
++!         public IndexRowIterator(Session session, Index index, Node node) {
++  
++              if (index == null) {
++                  return;
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcCallableStatement.java hsqldb/src/org/hsqldb/jdbc/jdbcCallableStatement.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcCallableStatement.java	2006-02-16 04:47:58.000000000 +0100
++--- hsqldb/src/org/hsqldb/jdbc/jdbcCallableStatement.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 296,306 ****
++  implements CallableStatement {
++  
++      /** parameter name => parameter index */
++!     private IntValueHashMap parameterNameMap;
++  
++      /** parameter index => registered OUT type */
++  
++!     //    private IntKeyIntValueHashMap outRegistrationMap;
++  
++      /**
++       * Constructs a new jdbcCallableStatement with the specified connection and
++--- 296,306 ----
++  implements CallableStatement {
++  
++      /** parameter name => parameter index */
++!     public IntValueHashMap parameterNameMap;
++  
++      /** parameter index => registered OUT type */
++  
++!     //    public IntKeyIntValueHashMap outRegistrationMap;
++  
++      /**
++       * Constructs a new jdbcCallableStatement with the specified connection and
++***************
++*** 385,391 ****
++       * @param i the one-based column index to check
++       * @throws SQLException if there is no such OUT or IN OUT column
++       */
++!     private void checkGetParameterIndex(int i) throws SQLException {
++  
++          checkClosed();
++  
++--- 385,391 ----
++       * @param i the one-based column index to check
++       * @throws SQLException if there is no such OUT or IN OUT column
++       */
++!     public void checkGetParameterIndex(int i) throws SQLException {
++  
++          checkClosed();
++  
++***************
++*** 421,427 ****
++       * @throws SQLException if not registered
++       */
++      /*
++!     private void checkIsRegisteredParameterIndex(int parameterIndex)
++      throws SQLException {
++  
++          int    type;
++--- 421,427 ----
++       * @throws SQLException if not registered
++       */
++      /*
++!     public void checkIsRegisteredParameterIndex(int parameterIndex)
++      throws SQLException {
++  
++          int    type;
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcColumnMetaData.java hsqldb/src/org/hsqldb/jdbc/jdbcColumnMetaData.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcColumnMetaData.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/jdbc/jdbcColumnMetaData.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 126,132 ****
++       *
++       * @return a Sring representation of this object
++       */
++!     private String toStringImpl() throws Exception {
++  
++          StringBuffer sb;
++          Field[]      fields;
++--- 126,132 ----
++       *
++       * @return a Sring representation of this object
++       */
++!     public String toStringImpl() throws Exception {
++  
++          StringBuffer sb;
++          Field[]      fields;
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcConnection.java hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcConnection.java	2007-07-30 11:26:06.000000000 +0200
++--- hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 422,428 ****
++      boolean isInternal;
++  
++      /** Is this connection to a network server instance. */
++!     protected boolean isNetConn;
++  
++      /**
++       * Is this connection closed?
++--- 422,428 ----
++      boolean isInternal;
++  
++      /** Is this connection to a network server instance. */
++!     public boolean isNetConn;
++  
++      /**
++       * Is this connection closed?
++***************
++*** 430,439 ****
++      boolean isClosed;
++  
++      /** The first warning in the chain. Null if there are no warnings. */
++!     private SQLWarning rootWarning;
++  
++      /** Synchronizes concurrent modification of the warning chain */
++!     private Object rootWarning_mutex = new Object();
++  
++      /**
++       * The set of open Statement objects returned by this Connection from
++--- 430,439 ----
++      boolean isClosed;
++  
++      /** The first warning in the chain. Null if there are no warnings. */
++!     public SQLWarning rootWarning;
++  
++      /** Synchronizes concurrent modification of the warning chain */
++!     public Object rootWarning_mutex = new Object();
++  
++      /**
++       * The set of open Statement objects returned by this Connection from
++***************
++*** 441,447 ****
++       * used solely for closing the statements when this Connection is closed.
++       */
++      /*
++!     private org.hsqldb.lib.HashSet statementSet =
++          new org.hsqldb.lib.HashSet();
++       */
++  
++--- 441,447 ----
++       * used solely for closing the statements when this Connection is closed.
++       */
++      /*
++!     public org.hsqldb.lib.HashSet statementSet =
++          new org.hsqldb.lib.HashSet();
++       */
++  
++***************
++*** 2462,2468 ****
++       *  The default implementation simply attempts to silently {@link
++       *  #close() close()} this <code>Connection</code>
++       */
++!     protected void finalize() {
++  
++          try {
++              close();
++--- 2462,2468 ----
++       *  The default implementation simply attempts to silently {@link
++       *  #close() close()} this <code>Connection</code>
++       */
++!     public void finalize() {
++  
++          try {
++              close();
++***************
++*** 2668,2674 ****
++      /**
++       * is called from within nativeSQL when the start of an JDBC escape sequence is encountered
++       */
++!     private int onStartEscapeSequence(String sql, StringBuffer sb,
++                                        int i) throws SQLException {
++  
++          sb.setCharAt(i++, ' ');
++--- 2668,2674 ----
++      /**
++       * is called from within nativeSQL when the start of an JDBC escape sequence is encountered
++       */
++!     public int onStartEscapeSequence(String sql, StringBuffer sb,
++                                        int i) throws SQLException {
++  
++          sb.setCharAt(i++, ' ');
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java	2006-10-25 14:36:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 282,300 ****
++      static final Integer INT_COLUMNS_NO_NULLS = new Integer(columnNoNulls);
++  
++      // -----------------------------------------------------------------------
++!     // private attributes
++      // -----------------------------------------------------------------------
++  
++      /**
++       * The connection this object uses to retrieve database instance-specific
++       * metadata.
++       */
++!     private jdbcConnection connection;
++  
++      /**
++       * Connection property for schema reporting.
++       */
++!     private boolean useSchemaDefault;
++  
++      /**
++       * A CSV list representing the SQL IN list to use when generating
++--- 282,300 ----
++      static final Integer INT_COLUMNS_NO_NULLS = new Integer(columnNoNulls);
++  
++      // -----------------------------------------------------------------------
++!     // public attributes
++      // -----------------------------------------------------------------------
++  
++      /**
++       * The connection this object uses to retrieve database instance-specific
++       * metadata.
++       */
++!     public jdbcConnection connection;
++  
++      /**
++       * Connection property for schema reporting.
++       */
++!     public boolean useSchemaDefault;
++  
++      /**
++       * A CSV list representing the SQL IN list to use when generating
++***************
++*** 302,308 ****
++       * <code>scope</code> argument is <code>bestRowSession</code>.
++       * @since HSQLDB 1.7.2
++       */
++!     private static final String BRI_SESSION_SCOPE_IN_LIST = "("
++          + bestRowSession + ")";
++  
++      /**
++--- 302,308 ----
++       * <code>scope</code> argument is <code>bestRowSession</code>.
++       * @since HSQLDB 1.7.2
++       */
++!     public static final String BRI_SESSION_SCOPE_IN_LIST = "("
++          + bestRowSession + ")";
++  
++      /**
++***************
++*** 311,317 ****
++       * <code>scope</code> argument is <code>bestRowTemporary</code>.
++       * @since HSQLDB 1.7.2
++       */
++!     private static final String BRI_TEMPORARY_SCOPE_IN_LIST = "("
++          + bestRowTemporary + "," + bestRowTransaction + "," + bestRowSession
++          + ")";
++  
++--- 311,317 ----
++       * <code>scope</code> argument is <code>bestRowTemporary</code>.
++       * @since HSQLDB 1.7.2
++       */
++!     public static final String BRI_TEMPORARY_SCOPE_IN_LIST = "("
++          + bestRowTemporary + "," + bestRowTransaction + "," + bestRowSession
++          + ")";
++  
++***************
++*** 321,327 ****
++       * <code>scope</code> argument is <code>bestRowTransaction</code>.
++       * @since HSQLDB 1.7.2
++       */
++!     private static final String BRI_TRANSACTION_SCOPE_IN_LIST = "("
++          + bestRowTransaction + "," + bestRowSession + ")";
++  
++      /**
++--- 321,327 ----
++       * <code>scope</code> argument is <code>bestRowTransaction</code>.
++       * @since HSQLDB 1.7.2
++       */
++!     public static final String BRI_TRANSACTION_SCOPE_IN_LIST = "("
++          + bestRowTransaction + "," + bestRowSession + ")";
++  
++      /**
++***************
++*** 332,338 ****
++       *
++       * @since HSQLDB 1.7.2
++       */
++!     private static final String selstar = "SELECT * FROM INFORMATION_SCHEMA.";
++  
++      /**
++       * " WHERE 1=1 ". <p>
++--- 332,338 ----
++       *
++       * @since HSQLDB 1.7.2
++       */
++!     public static final String selstar = "SELECT * FROM INFORMATION_SCHEMA.";
++  
++      /**
++       * " WHERE 1=1 ". <p>
++***************
++*** 347,353 ****
++       * end of this and Presto! Everything works :-) <p>
++       * @since HSQLDB 1.7.2
++       */
++!     private static final String whereTrue = " WHERE 1=1";
++  
++      //----------------------------------------------------------------------
++      // First, a variety of minor information about the target database.
++--- 347,353 ----
++       * end of this and Presto! Everything works :-) <p>
++       * @since HSQLDB 1.7.2
++       */
++!     public static final String whereTrue = " WHERE 1=1";
++  
++      //----------------------------------------------------------------------
++      // First, a variety of minor information about the target database.
++***************
++*** 5467,5473 ****
++       *
++       *      </UL>
++       */
++!     private static String and(String id, String op, Object val) {
++  
++          // The JDBC standard for pattern arguments seems to be:
++          //
++--- 5467,5473 ----
++       *
++       *      </UL>
++       */
++!     public static String and(String id, String op, Object val) {
++  
++          // The JDBC standard for pattern arguments seems to be:
++          //
++***************
++*** 5543,5549 ****
++       * @return the result of issuing the statement
++       * @throws SQLException is a database error occurs
++       */
++!     private ResultSet execute(String sql) throws SQLException {
++  
++          // NOTE:
++          // Need to create a jdbcStatement here so jdbcResultSet can return
++--- 5543,5549 ----
++       * @return the result of issuing the statement
++       * @throws SQLException is a database error occurs
++       */
++!     public ResultSet execute(String sql) throws SQLException {
++  
++          // NOTE:
++          // Need to create a jdbcStatement here so jdbcResultSet can return
++***************
++*** 5571,5577 ****
++       *
++       *  If the <em>where</em> clause is null, it is ommited.  <p>
++       *
++!      *  It is assumed that the table name is non-null, since this is a private
++       *  method.  No check is performed. <p>
++       *
++       * @return the result of executing "SELECT * FROM " + table " " + where
++--- 5571,5577 ----
++       *
++       *  If the <em>where</em> clause is null, it is ommited.  <p>
++       *
++!      *  It is assumed that the table name is non-null, since this is a public
++       *  method.  No check is performed. <p>
++       *
++       * @return the result of executing "SELECT * FROM " + table " " + where
++***************
++*** 5579,5585 ****
++       * @param where the where condition for the select
++       * @throws SQLException if database error occurs
++       */
++!     private ResultSet executeSelect(String table,
++                                      String where) throws SQLException {
++  
++          String select = selstar + table;
++--- 5579,5585 ----
++       * @param where the where condition for the select
++       * @throws SQLException if database error occurs
++       */
++!     public ResultSet executeSelect(String table,
++                                      String where) throws SQLException {
++  
++          String select = selstar + table;
++***************
++*** 5603,5609 ****
++       *      "SELECT * FROM &lt;table&gt; WHERE 1=1"
++       * @param t the name of the table
++       */
++!     private StringBuffer toQueryPrefix(String t) {
++  
++          StringBuffer sb = new StringBuffer(255);
++  
++--- 5603,5609 ----
++       *      "SELECT * FROM &lt;table&gt; WHERE 1=1"
++       * @param t the name of the table
++       */
++!     public StringBuffer toQueryPrefix(String t) {
++  
++          StringBuffer sb = new StringBuffer(255);
++  
++***************
++*** 5619,5625 ****
++       * @return true if the argument, s, is filter paramter value that
++       *        requires a corresponding IS NULL predicate
++       */
++!     private static boolean wantsIsNull(String s) {
++          return (s != null && s.length() == 0);
++      }
++  
++--- 5619,5625 ----
++       * @return true if the argument, s, is filter paramter value that
++       *        requires a corresponding IS NULL predicate
++       */
++!     public static boolean wantsIsNull(String s) {
++          return (s != null && s.length() == 0);
++      }
++  
++***************
++*** 5628,5634 ****
++       * is present, any DatabaseMetaData call with an empty string as the
++       * schema parameter will use the default schema (noramlly "PUBLIC").
++       */
++!     private String translateSchema(String schemaName) throws SQLException {
++  
++          if (useSchemaDefault && schemaName != null
++                  && schemaName.length() == 0) {
++--- 5628,5634 ----
++       * is present, any DatabaseMetaData call with an empty string as the
++       * schema parameter will use the default schema (noramlly "PUBLIC").
++       */
++!     public String translateSchema(String schemaName) throws SQLException {
++  
++          if (useSchemaDefault && schemaName != null
++                  && schemaName.length() == 0) {
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcDataSource.java hsqldb/src/org/hsqldb/jdbc/jdbcDataSource.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcDataSource.java	2005-12-22 13:42:28.000000000 +0100
++--- hsqldb/src/org/hsqldb/jdbc/jdbcDataSource.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 97,123 ****
++      /**
++       * Login timeout
++       */
++!     private int loginTimeout = 0;
++  
++      /**
++       * Log writer
++       */
++!     private transient PrintWriter logWriter;
++  
++      /**
++       * Default password to use for connections
++       */
++!     private String password = "";
++  
++      /**
++       * Default user to use for connections
++       */
++!     private String user = "";
++  
++      /**
++       * Database location
++       */
++!     private String database = "";
++  
++      /**
++       * Constructor
++--- 97,123 ----
++      /**
++       * Login timeout
++       */
++!     public int loginTimeout = 0;
++  
++      /**
++       * Log writer
++       */
++!     public transient PrintWriter logWriter;
++  
++      /**
++       * Default password to use for connections
++       */
++!     public String password = "";
++  
++      /**
++       * Default user to use for connections
++       */
++!     public String user = "";
++  
++      /**
++       * Database location
++       */
++!     public String database = "";
++  
++      /**
++       * Constructor
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcParameterMetaData.java hsqldb/src/org/hsqldb/jdbc/jdbcParameterMetaData.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcParameterMetaData.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/jdbc/jdbcParameterMetaData.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 314,320 ****
++       * @return a String representation of this object
++       * @throws Exception if a reflection error occurs
++       */
++!     private String toStringImpl() throws Exception {
++  
++          StringBuffer sb;
++          Method[]     methods;
++--- 314,320 ----
++       * @return a String representation of this object
++       * @throws Exception if a reflection error occurs
++       */
++!     public String toStringImpl() throws Exception {
++  
++          StringBuffer sb;
++          Method[]     methods;
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcPreparedStatement.java hsqldb/src/org/hsqldb/jdbc/jdbcPreparedStatement.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcPreparedStatement.java	2006-09-24 17:37:58.000000000 +0200
++--- hsqldb/src/org/hsqldb/jdbc/jdbcPreparedStatement.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 204,247 ****
++  implements PreparedStatement {
++  
++      /** The parameter values for the next non-batch execution. */
++!     protected Object[] parameterValues;
++  
++      /** Flags for bound variables. */
++!     protected boolean[] parameterSet;
++  
++      /** Flags for bound stream variables. */
++!     protected boolean[] parameterStream;
++  
++      /** The SQL types of the parameters. */
++!     protected int[] parameterTypes;
++  
++      /** The (IN, IN OUT, or OUT) modes of parameters */
++!     protected int[] parameterModes;
++  
++      /** Lengths for streams. */
++!     protected int[] streamLengths;
++  
++      /** Has a stream or CLOB / BLOB parameter value. */
++!     protected boolean hasStreams;
++  
++      /**
++       * Description of result set metadata. <p>
++       */
++!     protected Result rsmdDescriptor;
++  
++      /** Description of parameter metadata. */
++!     protected Result pmdDescriptor;
++  
++      /** This object's one and one ResultSetMetaData object. */
++!     protected jdbcResultSetMetaData rsmd;
++  
++  // NOTE:  pmd is declared as Object to avoid yet another #ifdef.
++  
++      /** This object's one and only ParameterMetaData object. */
++!     protected Object pmd;
++  
++      /** The SQL character sequence that this object represents. */
++!     protected String sql;
++  
++      /**
++       * The id with which this object's corresponding
++--- 204,247 ----
++  implements PreparedStatement {
++  
++      /** The parameter values for the next non-batch execution. */
++!     public Object[] parameterValues;
++  
++      /** Flags for bound variables. */
++!     public boolean[] parameterSet;
++  
++      /** Flags for bound stream variables. */
++!     public boolean[] parameterStream;
++  
++      /** The SQL types of the parameters. */
++!     public int[] parameterTypes;
++  
++      /** The (IN, IN OUT, or OUT) modes of parameters */
++!     public int[] parameterModes;
++  
++      /** Lengths for streams. */
++!     public int[] streamLengths;
++  
++      /** Has a stream or CLOB / BLOB parameter value. */
++!     public boolean hasStreams;
++  
++      /**
++       * Description of result set metadata. <p>
++       */
++!     public Result rsmdDescriptor;
++  
++      /** Description of parameter metadata. */
++!     public Result pmdDescriptor;
++  
++      /** This object's one and one ResultSetMetaData object. */
++!     public jdbcResultSetMetaData rsmd;
++  
++  // NOTE:  pmd is declared as Object to avoid yet another #ifdef.
++  
++      /** This object's one and only ParameterMetaData object. */
++!     public Object pmd;
++  
++      /** The SQL character sequence that this object represents. */
++!     public String sql;
++  
++      /**
++       * The id with which this object's corresponding
++***************
++*** 250,262 ****
++       * {@link org.hsqldb.CompiledStatementManager CompiledStatementManager}
++       * object.
++       */
++!     protected int statementID;
++  
++      /**
++       * Whether this statement generates only a single row update count in
++       * response to execution.
++       */
++!     protected boolean isRowCount;
++  
++  // fredt@users 20020215 - patch 517028 by peterhudson@users - method defined
++  // fredt@users 20020215 - patch 517028 by peterhudson@users - method defined
++--- 250,262 ----
++       * {@link org.hsqldb.CompiledStatementManager CompiledStatementManager}
++       * object.
++       */
++!     public int statementID;
++  
++      /**
++       * Whether this statement generates only a single row update count in
++       * response to execution.
++       */
++!     public boolean isRowCount;
++  
++  // fredt@users 20020215 - patch 517028 by peterhudson@users - method defined
++  // fredt@users 20020215 - patch 517028 by peterhudson@users - method defined
++***************
++*** 1899,1905 ****
++       *      something other than a single row update count.
++       * @throws SQLException if the argument, yes, does not match
++       */
++!     protected void checkIsRowCount(boolean yes) throws SQLException {
++  
++          if (yes != isRowCount) {
++              int msg = yes ? Trace.JDBC_STATEMENT_NOT_ROW_COUNT
++--- 1899,1905 ----
++       *      something other than a single row update count.
++       * @throws SQLException if the argument, yes, does not match
++       */
++!     public void checkIsRowCount(boolean yes) throws SQLException {
++  
++          if (yes != isRowCount) {
++              int msg = yes ? Trace.JDBC_STATEMENT_NOT_ROW_COUNT
++***************
++*** 1916,1922 ****
++       * @param i The parameter index to check
++       * @throws SQLException if the specified parameter index is invalid
++       */
++!     protected void checkSetParameterIndex(int i,
++                                            boolean isStream)
++                                            throws SQLException {
++  
++--- 1916,1922 ----
++       * @param i The parameter index to check
++       * @throws SQLException if the specified parameter index is invalid
++       */
++!     public void checkSetParameterIndex(int i,
++                                            boolean isStream)
++                                            throws SQLException {
++  
++***************
++*** 1966,1978 ****
++       * again for the next reuse. When set using other methods, the parameter
++       * setting is retained for the next use.
++       */
++!     private void checkParametersSet() throws SQLException {
++          ;
++      }
++  
++  /*
++      // do not check for compatibility with 1.8.0.x
++!     private void checkParametersSet() throws SQLException {
++  
++          if (parameterStream == null) {
++              for (int i = 0; i < parameterSet.length; i++) {
++--- 1966,1978 ----
++       * again for the next reuse. When set using other methods, the parameter
++       * setting is retained for the next use.
++       */
++!     public void checkParametersSet() throws SQLException {
++          ;
++      }
++  
++  /*
++      // do not check for compatibility with 1.8.0.x
++!     public void checkParametersSet() throws SQLException {
++  
++          if (parameterStream == null) {
++              for (int i = 0; i < parameterSet.length; i++) {
++***************
++*** 2003,2009 ****
++       * @param o object
++       * @throws SQLException if either argument is not acceptable.
++       */
++!     private void setParameter(int i, Object o) throws SQLException {
++  
++          checkSetParameterIndex(i, false);
++  
++--- 2003,2009 ----
++       * @param o object
++       * @throws SQLException if either argument is not acceptable.
++       */
++!     public void setParameter(int i, Object o) throws SQLException {
++  
++          checkSetParameterIndex(i, false);
++  
++***************
++*** 2087,2093 ****
++       * @param value object to set
++       * @throws SQLException if either argument is not acceptable
++       */
++!     private void setIntParameter(int i, int value) throws SQLException {
++  
++          checkSetParameterIndex(i, false);
++  
++--- 2087,2093 ----
++       * @param value object to set
++       * @throws SQLException if either argument is not acceptable
++       */
++!     public void setIntParameter(int i, int value) throws SQLException {
++  
++          checkSetParameterIndex(i, false);
++  
++***************
++*** 2116,2122 ****
++       * @param value object to set
++       * @throws SQLException if either argument is not acceptable
++       */
++!     private void setLongParameter(int i, long value) throws SQLException {
++  
++          checkSetParameterIndex(i, false);
++  
++--- 2116,2122 ----
++       * @param value object to set
++       * @throws SQLException if either argument is not acceptable
++       */
++!     public void setLongParameter(int i, long value) throws SQLException {
++  
++          checkSetParameterIndex(i, false);
++  
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcResultSet.java hsqldb/src/org/hsqldb/jdbc/jdbcResultSet.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcResultSet.java	2006-12-21 11:41:24.000000000 +0100
++--- hsqldb/src/org/hsqldb/jdbc/jdbcResultSet.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 412,442 ****
++      /**
++       * The current record containing the data for the row
++       */
++!     private Record nCurrent;
++  
++      /** The row upon which this ResultSet is currently positioned. */
++!     private int iCurrentRow;
++  
++      /** When the result of updating the database, the number of updated rows. */
++!     private int iUpdateCount;
++  
++      /** Is current row before the first row? */
++!     private boolean bInit;    // false if before first row
++  
++      /** How many columns does this ResultSet have? */
++      int iColumnCount;
++  
++      /** Did the last getXXX method encounter a null value? */
++!     private boolean bWasNull;
++  
++      /** The ResultSetMetaData object for this ResultSet */
++!     private ResultSetMetaData rsmd;
++  
++      /** Properties of this ResultSet's parent Connection. */
++!     private HsqlProperties connProperties;
++  
++      /** is the connection via network */
++!     private boolean isNetConn;
++  
++      /**
++       * The Statement that generated this result. Null if the result is
++--- 412,442 ----
++      /**
++       * The current record containing the data for the row
++       */
++!     public Record nCurrent;
++  
++      /** The row upon which this ResultSet is currently positioned. */
++!     public int iCurrentRow;
++  
++      /** When the result of updating the database, the number of updated rows. */
++!     public int iUpdateCount;
++  
++      /** Is current row before the first row? */
++!     public boolean bInit;    // false if before first row
++  
++      /** How many columns does this ResultSet have? */
++      int iColumnCount;
++  
++      /** Did the last getXXX method encounter a null value? */
++!     public boolean bWasNull;
++  
++      /** The ResultSetMetaData object for this ResultSet */
++!     public ResultSetMetaData rsmd;
++  
++      /** Properties of this ResultSet's parent Connection. */
++!     public HsqlProperties connProperties;
++  
++      /** is the connection via network */
++!     public boolean isNetConn;
++  
++      /**
++       * The Statement that generated this result. Null if the result is
++***************
++*** 4862,4868 ****
++       *
++       * @throws  SQLException when no row data is available
++       */
++!     private void checkAvailable() throws SQLException {
++  
++          if (rResult == null ||!bInit || nCurrent == null) {
++              throw Util.sqlException(Trace.NO_DATA_IS_AVAILABLE);
++--- 4862,4868 ----
++       *
++       * @throws  SQLException when no row data is available
++       */
++!     public void checkAvailable() throws SQLException {
++  
++          if (rResult == null ||!bInit || nCurrent == null) {
++              throw Util.sqlException(Trace.NO_DATA_IS_AVAILABLE);
++***************
++*** 4874,4880 ****
++       *
++       * @throws SQLException when this result set is closed
++       */
++!     private void checkClosed() throws SQLException {
++  
++          if (rResult == null
++                  || (sqlStatement != null && sqlStatement.isClosed)) {
++--- 4874,4880 ----
++       *
++       * @throws SQLException when this result set is closed
++       */
++!     public void checkClosed() throws SQLException {
++  
++          if (rResult == null
++                  || (sqlStatement != null && sqlStatement.isClosed)) {
++***************
++*** 4901,4907 ****
++       *
++       * @param  o the Object to track
++       */
++!     private boolean checkNull(Object o) {
++  
++          if (o == null) {
++              bWasNull = true;
++--- 4901,4907 ----
++       *
++       * @param  o the Object to track
++       */
++!     public boolean checkNull(Object o) {
++  
++          if (o == null) {
++              bWasNull = true;
++***************
++*** 4929,4935 ****
++       * @throws SQLException when there is no data, the column index is
++       *    invalid, or the conversion cannot be performed
++       */
++!     private Object getColumnInType(int columnIndex,
++                                     int type) throws SQLException {
++  
++          checkAvailable();
++--- 4929,4935 ----
++       * @throws SQLException when there is no data, the column index is
++       *    invalid, or the conversion cannot be performed
++       */
++!     public Object getColumnInType(int columnIndex,
++                                     int type) throws SQLException {
++  
++          checkAvailable();
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcResultSetMetaData.java hsqldb/src/org/hsqldb/jdbc/jdbcResultSetMetaData.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcResultSetMetaData.java	2006-09-24 17:37:58.000000000 +0200
++--- hsqldb/src/org/hsqldb/jdbc/jdbcResultSetMetaData.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 97,118 ****
++       * An array of objects, each of which represents the reported attributes
++       * for  a single column of this object's parent ResultSet.
++       */
++!     private jdbcColumnMetaData[] columnMetaData;
++  
++      /** The number of columns in this object's parent ResultSet. */
++!     private int columnCount;
++  
++      /**
++       * Whether to use the underlying column name or label when reporting
++       * getColumnName().
++       */
++!     private boolean useColumnName;
++  
++      /**
++       * If true, then timings for init() are printed
++       * to the console.
++       */
++!     private static final boolean TRACE = false;
++  
++      /**
++       * Constructs a new jdbcResultSetMetaData object from the specified
++--- 97,118 ----
++       * An array of objects, each of which represents the reported attributes
++       * for  a single column of this object's parent ResultSet.
++       */
++!     public jdbcColumnMetaData[] columnMetaData;
++  
++      /** The number of columns in this object's parent ResultSet. */
++!     public int columnCount;
++  
++      /**
++       * Whether to use the underlying column name or label when reporting
++       * getColumnName().
++       */
++!     public boolean useColumnName;
++  
++      /**
++       * If true, then timings for init() are printed
++       * to the console.
++       */
++!     public static final boolean TRACE = false;
++  
++      /**
++       * Constructs a new jdbcResultSetMetaData object from the specified
++***************
++*** 1137,1143 ****
++       * @throws SQLException when this object's parent ResultSet has
++       *      no such column
++       */
++!     private void checkColumn(int column) throws SQLException {
++  
++          if (column < 1 || column > columnCount) {
++              throw Util.sqlException(Trace.COLUMN_NOT_FOUND,
++--- 1137,1143 ----
++       * @throws SQLException when this object's parent ResultSet has
++       *      no such column
++       */
++!     public void checkColumn(int column) throws SQLException {
++  
++          if (column < 1 || column > columnCount) {
++              throw Util.sqlException(Trace.COLUMN_NOT_FOUND,
++diff -crN hsqldb-old/src/org/hsqldb/jdbc/jdbcStatement.java hsqldb/src/org/hsqldb/jdbc/jdbcStatement.java
++*** hsqldb-old/src/org/hsqldb/jdbc/jdbcStatement.java	2007-07-30 11:26:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/jdbc/jdbcStatement.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 134,158 ****
++      volatile boolean isClosed;
++  
++      /** Is escape processing enabled? */
++!     private boolean isEscapeProcessing = true;
++  
++      /** The connection used to execute this statement. */
++!     protected jdbcConnection connection;
++  
++      /** The maximum number of rows to generate when executing this statement. */
++!     protected int maxRows;
++  
++      /** The result of executing this statement. */
++!     protected Result resultIn;
++  
++      /** The result set type obtained by executing this statement. */
++!     protected int rsType = jdbcResultSet.TYPE_FORWARD_ONLY;
++  
++      /** Used by this statement to communicate non-batched requests. */
++!     protected Result resultOut = new Result(ResultConstants.SQLEXECDIRECT);
++  
++      /** Use by this statement to communicate batched execution requests */
++!     protected Result batchResultOut = null;
++  
++      // boucherb@users
++      // NOTE:
++--- 134,158 ----
++      volatile boolean isClosed;
++  
++      /** Is escape processing enabled? */
++!     public boolean isEscapeProcessing = true;
++  
++      /** The connection used to execute this statement. */
++!     public jdbcConnection connection;
++  
++      /** The maximum number of rows to generate when executing this statement. */
++!     public int maxRows;
++  
++      /** The result of executing this statement. */
++!     public Result resultIn;
++  
++      /** The result set type obtained by executing this statement. */
++!     public int rsType = jdbcResultSet.TYPE_FORWARD_ONLY;
++  
++      /** Used by this statement to communicate non-batched requests. */
++!     public Result resultOut = new Result(ResultConstants.SQLEXECDIRECT);
++  
++      /** Use by this statement to communicate batched execution requests */
++!     public Result batchResultOut = null;
++  
++      // boucherb@users
++      // NOTE:
++***************
++*** 1558,1564 ****
++       * @param sql a character sequence representing the SQL to be executed
++       * @throws SQLException when a database access error occurs
++       */
++!     private void fetchResult(String sql) throws SQLException {
++  
++          if (isEscapeProcessing) {
++              sql = connection.nativeSQL(sql);
++--- 1558,1564 ----
++       * @param sql a character sequence representing the SQL to be executed
++       * @throws SQLException when a database access error occurs
++       */
++!     public void fetchResult(String sql) throws SQLException {
++  
++          if (isEscapeProcessing) {
++              sql = connection.nativeSQL(sql);
++diff -crN hsqldb-old/src/org/hsqldb/lib/ArrayUtil.java hsqldb/src/org/hsqldb/lib/ArrayUtil.java
++*** hsqldb-old/src/org/hsqldb/lib/ArrayUtil.java	2006-02-16 04:47:58.000000000 +0100
++--- hsqldb/src/org/hsqldb/lib/ArrayUtil.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 51,57 ****
++      public static final int        CLASS_CODE_OBJECT  = 'L';
++      public static final int        CLASS_CODE_SHORT   = 'S';
++      public static final int        CLASS_CODE_BOOLEAN = 'Z';
++!     private static IntValueHashMap classCodeMap       = new IntValueHashMap();
++  
++      static {
++          classCodeMap.put(byte.class, ArrayUtil.CLASS_CODE_BYTE);
++--- 51,57 ----
++      public static final int        CLASS_CODE_OBJECT  = 'L';
++      public static final int        CLASS_CODE_SHORT   = 'S';
++      public static final int        CLASS_CODE_BOOLEAN = 'Z';
++!     public static IntValueHashMap classCodeMap       = new IntValueHashMap();
++  
++      static {
++          classCodeMap.put(byte.class, ArrayUtil.CLASS_CODE_BYTE);
++diff -crN hsqldb-old/src/org/hsqldb/lib/BaseList.java hsqldb/src/org/hsqldb/lib/BaseList.java
++*** hsqldb-old/src/org/hsqldb/lib/BaseList.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/BaseList.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 42,48 ****
++   */
++  abstract class BaseList {
++  
++!     protected int elementCount;
++  
++      abstract Object get(int index);
++  
++--- 42,48 ----
++   */
++  abstract class BaseList {
++  
++!     public int elementCount;
++  
++      abstract Object get(int index);
++  
++***************
++*** 135,141 ****
++          return new BaseListIterator();
++      }
++  
++!     private class BaseListIterator implements Iterator {
++  
++          int     counter = 0;
++          boolean removed;
++--- 135,141 ----
++          return new BaseListIterator();
++      }
++  
++!     public class BaseListIterator implements Iterator {
++  
++          int     counter = 0;
++          boolean removed;
++diff -crN hsqldb-old/src/org/hsqldb/lib/DoubleIntIndex.java hsqldb/src/org/hsqldb/lib/DoubleIntIndex.java
++*** hsqldb-old/src/org/hsqldb/lib/DoubleIntIndex.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/DoubleIntIndex.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 52,68 ****
++   */
++  public class DoubleIntIndex implements IntLookup {
++  
++!     private int           count = 0;
++!     private int           capacity;
++!     private boolean       sorted       = true;
++!     private boolean       sortOnValues = true;
++!     private boolean       hasChanged;
++!     private final boolean fixedSize;
++!     private int[]         keys;
++!     private int[]         values;
++  
++  //
++!     private int targetSearchValue;
++  
++      public DoubleIntIndex(int capacity, boolean fixedSize) {
++  
++--- 52,68 ----
++   */
++  public class DoubleIntIndex implements IntLookup {
++  
++!     public int           count = 0;
++!     public int           capacity;
++!     public boolean       sorted       = true;
++!     public boolean       sortOnValues = true;
++!     public boolean       hasChanged;
++!     public final boolean fixedSize;
++!     public int[]         keys;
++!     public int[]         values;
++  
++  //
++!     public int targetSearchValue;
++  
++      public DoubleIntIndex(int capacity, boolean fixedSize) {
++  
++***************
++*** 395,401 ****
++       * or -1
++       * @return index or -1 if not found
++       */
++!     private int binaryFirstSearch() {
++  
++          int low     = 0;
++          int high    = count;
++--- 395,401 ----
++       * or -1
++       * @return index or -1 if not found
++       */
++!     public int binaryFirstSearch() {
++  
++          int low     = 0;
++          int high    = count;
++***************
++*** 425,431 ****
++       * Returns the index of the lowest element > the given search target
++       *     @return the index
++       */
++!     private int binaryGreaterSearch() {
++  
++          int low     = 0;
++          int high    = count;
++--- 425,431 ----
++       * Returns the index of the lowest element > the given search target
++       *     @return the index
++       */
++!     public int binaryGreaterSearch() {
++  
++          int low     = 0;
++          int high    = count;
++***************
++*** 452,458 ****
++       * or count
++       *     @return the index
++       */
++!     private int binarySlotSearch() {
++  
++          int low     = 0;
++          int high    = count;
++--- 452,458 ----
++       * or count
++       *     @return the index
++       */
++!     public int binarySlotSearch() {
++  
++          int low     = 0;
++          int high    = count;
++***************
++*** 478,484 ****
++       * or count or -1 if target is found
++       * @return the index
++       */
++!     private int binaryEmptySlotSearch() {
++  
++          int low     = 0;
++          int high    = count;
++--- 478,484 ----
++       * or count or -1 if target is found
++       * @return the index
++       */
++!     public int binaryEmptySlotSearch() {
++  
++          int low     = 0;
++          int high    = count;
++***************
++*** 501,507 ****
++          return low;
++      }
++  
++!     private synchronized void fastQuickSort() {
++  
++          quickSort(0, count - 1);
++          insertionSort(0, count - 1);
++--- 501,507 ----
++          return low;
++      }
++  
++!     public synchronized void fastQuickSort() {
++  
++          quickSort(0, count - 1);
++          insertionSort(0, count - 1);
++***************
++*** 509,515 ****
++          sorted = true;
++      }
++  
++!     private void quickSort(int l, int r) {
++  
++          int M = 4;
++          int i;
++--- 509,515 ----
++          sorted = true;
++      }
++  
++!     public void quickSort(int l, int r) {
++  
++          int M = 4;
++          int i;
++***************
++*** 556,562 ****
++          }
++      }
++  
++!     private void insertionSort(int lo0, int hi0) {
++  
++          int i;
++          int j;
++--- 556,562 ----
++          }
++      }
++  
++!     public void insertionSort(int lo0, int hi0) {
++  
++          int i;
++          int j;
++***************
++*** 574,580 ****
++          }
++      }
++  
++!     private void moveAndInsertRow(int i, int j) {
++  
++          int col1 = keys[i];
++          int col2 = values[i];
++--- 574,580 ----
++          }
++      }
++  
++!     public void moveAndInsertRow(int i, int j) {
++  
++          int col1 = keys[i];
++          int col2 = values[i];
++***************
++*** 585,598 ****
++          values[j] = col2;
++      }
++  
++!     private void doubleCapacity() {
++  
++          keys     = (int[]) ArrayUtil.resizeArray(keys, capacity * 2);
++          values   = (int[]) ArrayUtil.resizeArray(values, capacity * 2);
++          capacity *= 2;
++      }
++  
++!     private void swap(int i1, int i2) {
++  
++          int col1 = keys[i1];
++          int col2 = values[i1];
++--- 585,598 ----
++          values[j] = col2;
++      }
++  
++!     public void doubleCapacity() {
++  
++          keys     = (int[]) ArrayUtil.resizeArray(keys, capacity * 2);
++          values   = (int[]) ArrayUtil.resizeArray(values, capacity * 2);
++          capacity *= 2;
++      }
++  
++!     public void swap(int i1, int i2) {
++  
++          int col1 = keys[i1];
++          int col2 = values[i1];
++***************
++*** 603,609 ****
++          values[i2] = col2;
++      }
++  
++!     private void moveRows(int fromIndex, int toIndex, int rows) {
++          System.arraycopy(keys, fromIndex, keys, toIndex, rows);
++          System.arraycopy(values, fromIndex, values, toIndex, rows);
++      }
++--- 603,609 ----
++          values[i2] = col2;
++      }
++  
++!     public void moveRows(int fromIndex, int toIndex, int rows) {
++          System.arraycopy(keys, fromIndex, keys, toIndex, rows);
++          System.arraycopy(values, fromIndex, values, toIndex, rows);
++      }
++***************
++*** 631,637 ****
++       * @param i the index
++       * @return -1, 0 or +1
++       */
++!     private int compare(int i) {
++  
++          if (sortOnValues) {
++              if (targetSearchValue > values[i]) {
++--- 631,637 ----
++       * @param i the index
++       * @return -1, 0 or +1
++       */
++!     public int compare(int i) {
++  
++          if (sortOnValues) {
++              if (targetSearchValue > values[i]) {
++***************
++*** 668,674 ****
++       * @param j the second index
++       * @return true or false
++       */
++!     private boolean lessThan(int i, int j) {
++  
++          if (sortOnValues) {
++              if (values[i] < values[j]) {
++--- 668,674 ----
++       * @param j the second index
++       * @return true or false
++       */
++!     public boolean lessThan(int i, int j) {
++  
++          if (sortOnValues) {
++              if (values[i] < values[j]) {
++diff -crN hsqldb-old/src/org/hsqldb/lib/FileUtil.java hsqldb/src/org/hsqldb/lib/FileUtil.java
++*** hsqldb-old/src/org/hsqldb/lib/FileUtil.java	2007-10-19 22:16:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/FileUtil.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 52,58 ****
++   */
++  public class FileUtil implements FileAccess {
++  
++!     private static FileUtil fileUtil = new FileUtil();
++  
++      /** Creates a new instance of FileUtil */
++      FileUtil() {}
++--- 52,58 ----
++   */
++  public class FileUtil implements FileAccess {
++  
++!     public static FileUtil fileUtil = new FileUtil();
++  
++      /** Creates a new instance of FileUtil */
++      FileUtil() {}
++***************
++*** 166,172 ****
++       * If a file with oldname does not exist, no file will exist after the
++       * operation.
++       */
++!     private void renameOverwrite(String oldname, String newname) {
++  
++          delete(newname);
++  
++--- 166,172 ----
++       * If a file with oldname does not exist, no file will exist after the
++       * operation.
++       */
++!     public void renameOverwrite(String oldname, String newname) {
++  
++          delete(newname);
++  
++diff -crN hsqldb-old/src/org/hsqldb/lib/HashMappedList.java hsqldb/src/org/hsqldb/lib/HashMappedList.java
++*** hsqldb-old/src/org/hsqldb/lib/HashMappedList.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HashMappedList.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 182,188 ****
++          return getLookup(key, key.hashCode());
++      }
++  
++!     private void checkRange(int i) {
++  
++          if (i < 0 || i >= size()) {
++              throw new IndexOutOfBoundsException();
++--- 182,188 ----
++          return getLookup(key, key.hashCode());
++      }
++  
++!     public void checkRange(int i) {
++  
++          if (i < 0 || i >= size()) {
++              throw new IndexOutOfBoundsException();
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlArrayHeap.java hsqldb/src/org/hsqldb/lib/HsqlArrayHeap.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlArrayHeap.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlArrayHeap.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 43,51 ****
++  public class HsqlArrayHeap implements HsqlHeap {
++  
++  // --------------------------------- members -----------------------------------
++!     protected ObjectComparator oc;
++!     protected int              count;
++!     protected Object[]         heap;
++  
++  // ------------------------------ constructors ---------------------------------
++  
++--- 43,51 ----
++  public class HsqlArrayHeap implements HsqlHeap {
++  
++  // --------------------------------- members -----------------------------------
++!     public ObjectComparator oc;
++!     public int              count;
++!     public Object[]         heap;
++  
++  // ------------------------------ constructors ---------------------------------
++  
++***************
++*** 311,317 ****
++  //        System.arraycopy(oldheap, 0, heap, 0, count);
++  //    }
++  // -------------------- internal implementation methods ------------------------
++!     private void increaseCapacity() {
++  
++          Object[] oldheap;
++  
++--- 311,317 ----
++  //        System.arraycopy(oldheap, 0, heap, 0, count);
++  //    }
++  // -------------------- internal implementation methods ------------------------
++!     public void increaseCapacity() {
++  
++          Object[] oldheap;
++  
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlArrayList.java hsqldb/src/org/hsqldb/lib/HsqlArrayList.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlArrayList.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlArrayList.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 47,58 ****
++  
++  //fredt@users
++  /*
++!     private static Reporter reporter = new Reporter();
++  
++!     private static class Reporter {
++  
++!         private static int initCounter   = 0;
++!         private static int updateCounter = 0;
++  
++          Reporter() {
++  
++--- 47,58 ----
++  
++  //fredt@users
++  /*
++!     public static Reporter reporter = new Reporter();
++  
++!     public static class Reporter {
++  
++!         public static int initCounter   = 0;
++!         public static int updateCounter = 0;
++  
++          Reporter() {
++  
++***************
++*** 61,67 ****
++              } catch (SecurityException e) {}
++          }
++  
++!         protected void finalize() {
++  
++              System.out.println("HsqlArrayList init count: " + initCounter);
++              System.out.println("HsqlArrayList update count: "
++--- 61,67 ----
++              } catch (SecurityException e) {}
++          }
++  
++!         public void finalize() {
++  
++              System.out.println("HsqlArrayList init count: " + initCounter);
++              System.out.println("HsqlArrayList update count: "
++***************
++*** 69,78 ****
++          }
++      }
++  */
++!     private static final int   DEFAULT_INITIAL_CAPACITY = 10;
++!     private static final float DEFAULT_RESIZE_FACTOR    = 2.0f;
++!     private Object[]           elementData;
++!     private boolean            minimizeOnClear;
++  
++      /** Creates a new instance of HsqlArrayList */
++      public HsqlArrayList() {
++--- 69,78 ----
++          }
++      }
++  */
++!     public static final int   DEFAULT_INITIAL_CAPACITY = 10;
++!     public static final float DEFAULT_RESIZE_FACTOR    = 2.0f;
++!     public Object[]           elementData;
++!     public boolean            minimizeOnClear;
++  
++      /** Creates a new instance of HsqlArrayList */
++      public HsqlArrayList() {
++***************
++*** 236,242 ****
++          return elementCount;
++      }
++  
++!     private void increaseCapacity() {
++  
++          int baseSize = elementData.length == 0 ? 1
++                                                 : elementData.length;
++--- 236,242 ----
++          return elementCount;
++      }
++  
++!     public void increaseCapacity() {
++  
++          int baseSize = elementData.length == 0 ? 1
++                                                 : elementData.length;
++***************
++*** 259,265 ****
++  
++          Enumeration en = new Enumeration() {
++  
++!             private int pos = 0;
++  
++              public Object nextElement() {
++  
++--- 259,265 ----
++  
++          Enumeration en = new Enumeration() {
++  
++!             public int pos = 0;
++  
++              public Object nextElement() {
++  
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlByteArrayInputStream.java hsqldb/src/org/hsqldb/lib/HsqlByteArrayInputStream.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlByteArrayInputStream.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlByteArrayInputStream.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 47,56 ****
++  public class HsqlByteArrayInputStream extends InputStream
++  implements DataInput {
++  
++!     protected byte[] buf;
++!     protected int    pos;
++!     protected int    mark = 0;
++!     protected int    count;
++  
++      public HsqlByteArrayInputStream(byte[] buf) {
++  
++--- 47,56 ----
++  public class HsqlByteArrayInputStream extends InputStream
++  implements DataInput {
++  
++!     public byte[] buf;
++!     public int    pos;
++!     public int    mark = 0;
++!     public int    count;
++  
++      public HsqlByteArrayInputStream(byte[] buf) {
++  
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlByteArrayOutputStream.java hsqldb/src/org/hsqldb/lib/HsqlByteArrayOutputStream.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlByteArrayOutputStream.java	2006-06-15 13:20:28.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlByteArrayOutputStream.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 48,55 ****
++  public class HsqlByteArrayOutputStream extends java.io.OutputStream
++  implements DataOutput {
++  
++!     protected byte[] buf;
++!     protected int    count;
++  
++      public HsqlByteArrayOutputStream() {
++          this(128);
++--- 48,55 ----
++  public class HsqlByteArrayOutputStream extends java.io.OutputStream
++  implements DataOutput {
++  
++!     public byte[] buf;
++!     public int    count;
++  
++      public HsqlByteArrayOutputStream() {
++          this(128);
++***************
++*** 251,257 ****
++          return this.buf;
++      }
++  
++!     protected void ensureRoom(int extra) {
++  
++          int newcount = count + extra;
++          int newsize  = buf.length;
++--- 251,257 ----
++          return this.buf;
++      }
++  
++!     public void ensureRoom(int extra) {
++  
++          int newcount = count + extra;
++          int newsize  = buf.length;
++***************
++*** 269,275 ****
++          }
++      }
++  
++!     protected void reset(int newSize) {
++  
++          count = 0;
++  
++--- 269,275 ----
++          }
++      }
++  
++!     public void reset(int newSize) {
++  
++          count = 0;
++  
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlDeque.java hsqldb/src/org/hsqldb/lib/HsqlDeque.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlDeque.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlDeque.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 47,59 ****
++   */
++  public class HsqlDeque extends BaseList implements HsqlList {
++  
++!     private Object[] list;
++!     private int      firstindex = 0;    // index of first list element
++!     private int      endindex   = 0;    // index of last list element + 1
++  
++      // can grow to fill list
++      // if elementCount == 0 then firstindex == endindex
++!     private static final int DEFAULT_INITIAL_CAPACITY = 10;
++  
++      public HsqlDeque() {
++          list = new Object[DEFAULT_INITIAL_CAPACITY];
++--- 47,59 ----
++   */
++  public class HsqlDeque extends BaseList implements HsqlList {
++  
++!     public Object[] list;
++!     public int      firstindex = 0;    // index of first list element
++!     public int      endindex   = 0;    // index of last list element + 1
++  
++      // can grow to fill list
++      // if elementCount == 0 then firstindex == endindex
++!     public static final int DEFAULT_INITIAL_CAPACITY = 10;
++  
++      public HsqlDeque() {
++          list = new Object[DEFAULT_INITIAL_CAPACITY];
++***************
++*** 242,248 ****
++          return value;
++      }
++  
++!     private int getInternalIndex(int i) throws IndexOutOfBoundsException {
++  
++          if (i < 0 || i >= elementCount) {
++              throw new IndexOutOfBoundsException();
++--- 242,248 ----
++          return value;
++      }
++  
++!     public int getInternalIndex(int i) throws IndexOutOfBoundsException {
++  
++          if (i < 0 || i >= elementCount) {
++              throw new IndexOutOfBoundsException();
++***************
++*** 257,263 ****
++          return index;
++      }
++  
++!     private void resetCapacity() {
++  
++          if (elementCount < list.length) {
++              return;
++--- 257,263 ----
++          return index;
++      }
++  
++!     public void resetCapacity() {
++  
++          if (elementCount < list.length) {
++              return;
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlLinkedList.java hsqldb/src/org/hsqldb/lib/HsqlLinkedList.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlLinkedList.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlLinkedList.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 46,55 ****
++       * A reference to the head of the list.  It is a dummy head (that is, the
++       * Node for index 0 is actually first.next).
++       */
++!     private Node first;
++  
++      /** A reference to the tail of the list */
++!     private Node last;
++  
++      /**
++       * Creates a new instance of HsqlLinkedList.
++--- 46,55 ----
++       * A reference to the head of the list.  It is a dummy head (that is, the
++       * Node for index 0 is actually first.next).
++       */
++!     public Node first;
++  
++      /** A reference to the tail of the list */
++!     public Node last;
++  
++      /**
++       * Creates a new instance of HsqlLinkedList.
++***************
++*** 197,203 ****
++       * index within the list (0 &lt;= <code>index</code> &lt;
++       * <code>size</code>).
++       */
++!     protected final Node getInternal(int index) {
++  
++          //Check preconditions for the index variable
++          if (index >= size()) {
++--- 197,203 ----
++       * index within the list (0 &lt;= <code>index</code> &lt;
++       * <code>size</code>).
++       */
++!     public final Node getInternal(int index) {
++  
++          //Check preconditions for the index variable
++          if (index >= size()) {
++***************
++*** 232,238 ****
++       * jcpeck@users
++       * @version 05/24/2002
++       */
++!     private static class Node {
++  
++          public Node   next;
++          public Object data;
++--- 232,238 ----
++       * jcpeck@users
++       * @version 05/24/2002
++       */
++!     public static class Node {
++  
++          public Node   next;
++          public Object data;
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlTaskQueue.java hsqldb/src/org/hsqldb/lib/HsqlTaskQueue.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlTaskQueue.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlTaskQueue.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 43,52 ****
++  public class HsqlTaskQueue {
++  
++      /** The thread used to process commands */
++!     protected Thread taskRunnerThread;
++  
++      /** Special queue element to signal termination */
++!     protected static final Runnable SHUTDOWNTASK = new Runnable() {
++          public void run() {}
++      };
++  
++--- 43,52 ----
++  public class HsqlTaskQueue {
++  
++      /** The thread used to process commands */
++!     public Thread taskRunnerThread;
++  
++      /** Special queue element to signal termination */
++!     public static final Runnable SHUTDOWNTASK = new Runnable() {
++          public void run() {}
++      };
++  
++***************
++*** 55,73 ****
++       *
++       * Once set true, stays true forever
++       */
++!     protected volatile boolean isShutdown;
++  
++      public synchronized Thread getTaskRunnerThread() {
++          return taskRunnerThread;
++      }
++  
++!     protected synchronized void clearThread() {
++          taskRunnerThread = null;
++      }
++  
++!     protected final HsqlDeque queue = new HsqlDeque();
++  
++!     protected class TaskRunner implements Runnable {
++  
++          public void run() {
++  
++--- 55,73 ----
++       *
++       * Once set true, stays true forever
++       */
++!     public volatile boolean isShutdown;
++  
++      public synchronized Thread getTaskRunnerThread() {
++          return taskRunnerThread;
++      }
++  
++!     public synchronized void clearThread() {
++          taskRunnerThread = null;
++      }
++  
++!     public final HsqlDeque queue = new HsqlDeque();
++  
++!     public class TaskRunner implements Runnable {
++  
++          public void run() {
++  
++***************
++*** 101,107 ****
++          }
++      }
++  
++!     protected final TaskRunner taskRunner = new TaskRunner();
++  
++      public HsqlTaskQueue() {}
++  
++--- 101,107 ----
++          }
++      }
++  
++!     public final TaskRunner taskRunner = new TaskRunner();
++  
++      public HsqlTaskQueue() {}
++  
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlThreadFactory.java hsqldb/src/org/hsqldb/lib/HsqlThreadFactory.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlThreadFactory.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlThreadFactory.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 47,53 ****
++       * The factory implementation.  Typically, this will be the
++       * HsqlThreadFactory object itself.
++       */
++!     protected ThreadFactory factory;
++  
++      /**
++       * Constructs a new HsqlThreadFactory that uses itself as the factory
++--- 47,53 ----
++       * The factory implementation.  Typically, this will be the
++       * HsqlThreadFactory object itself.
++       */
++!     public ThreadFactory factory;
++  
++      /**
++       * Constructs a new HsqlThreadFactory that uses itself as the factory
++diff -crN hsqldb-old/src/org/hsqldb/lib/HsqlTimer.java hsqldb/src/org/hsqldb/lib/HsqlTimer.java
++*** hsqldb-old/src/org/hsqldb/lib/HsqlTimer.java	2007-10-24 08:58:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/HsqlTimer.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 55,78 ****
++  public final class HsqlTimer implements ObjectComparator, ThreadFactory {
++  
++      /** The priority queue for the scheduled tasks. */
++!     protected final TaskQueue taskQueue = new TaskQueue(16,
++          (ObjectComparator) this);
++  
++      /** The inner runnable that executes tasks in the background thread. */
++!     protected final TaskRunner taskRunner = new TaskRunner();
++  
++      /** The background thread. */
++!     protected Thread taskRunnerThread;
++  
++      /** The factory that procduces the background threads. */
++!     protected final ThreadFactory threadFactory;
++  
++      /**
++       * Whether this timer should disallow all further processing.
++       *
++       * Once set true, stays true forever.
++       */
++!     protected volatile boolean isShutdown;
++  
++      /**
++       * Constructs a new HsqlTimer using the default thread factory
++--- 55,78 ----
++  public final class HsqlTimer implements ObjectComparator, ThreadFactory {
++  
++      /** The priority queue for the scheduled tasks. */
++!     public final TaskQueue taskQueue = new TaskQueue(16,
++          (ObjectComparator) this);
++  
++      /** The inner runnable that executes tasks in the background thread. */
++!     public final TaskRunner taskRunner = new TaskRunner();
++  
++      /** The background thread. */
++!     public Thread taskRunnerThread;
++  
++      /** The factory that procduces the background threads. */
++!     public final ThreadFactory threadFactory;
++  
++      /**
++       * Whether this timer should disallow all further processing.
++       *
++       * Once set true, stays true forever.
++       */
++!     public volatile boolean isShutdown;
++  
++      /**
++       * Constructs a new HsqlTimer using the default thread factory
++***************
++*** 460,466 ****
++       * @param relative if true, use fixed rate else use fixed delay scheduling
++       * @return an opaque reference to the internal task
++       */
++!     protected Task addTask(final long first, final Runnable runnable,
++                             final long period, boolean relative) {
++  
++          if (this.isShutdown) {
++--- 460,466 ----
++       * @param relative if true, use fixed rate else use fixed delay scheduling
++       * @return an opaque reference to the internal task
++       */
++!     public Task addTask(final long first, final Runnable runnable,
++                             final long period, boolean relative) {
++  
++          if (this.isShutdown) {
++***************
++*** 479,485 ****
++      }
++  
++      /** Sets the background thread to null. */
++!     protected synchronized void clearThread() {
++          taskRunnerThread = null;
++      }
++  
++--- 479,485 ----
++      }
++  
++      /** Sets the background thread to null. */
++!     public synchronized void clearThread() {
++          taskRunnerThread = null;
++      }
++  
++***************
++*** 489,495 ****
++       *
++       * @return the next task to execute, or null
++       */
++!     protected Task nextTask() {
++  
++          try {
++              while (!this.isShutdown || Thread.interrupted()) {
++--- 489,495 ----
++       *
++       * @return the next task to execute, or null
++       */
++!     public Task nextTask() {
++  
++          try {
++              while (!this.isShutdown || Thread.interrupted()) {
++***************
++*** 572,578 ****
++       *
++       * @return System.currentTimeMillis()
++       */
++!     private static long now() {
++  
++          nowCount++;
++  
++--- 572,578 ----
++       *
++       * @return System.currentTimeMillis()
++       */
++!     public static long now() {
++  
++          nowCount++;
++  
++***************
++*** 587,593 ****
++       * but using an inner class protects the public run method
++       * from potential abuse.
++       */
++!     protected class TaskRunner implements Runnable {
++  
++          /**
++           * Runs the next available task in the background thread. <p>
++--- 587,593 ----
++       * but using an inner class protects the public run method
++       * from potential abuse.
++       */
++!     public class TaskRunner implements Runnable {
++  
++          /**
++           * Runs the next available task in the background thread. <p>
++***************
++*** 649,655 ****
++       * for execution by the enclosing HsqlTimer's TaskRunner in a
++       * background thread.
++       */
++!     protected class Task {
++  
++          /** What to run. */
++          Runnable runnable;
++--- 649,655 ----
++       * for execution by the enclosing HsqlTimer's TaskRunner in a
++       * background thread.
++       */
++!     public class Task {
++  
++          /** What to run. */
++          Runnable runnable;
++***************
++*** 671,677 ****
++          boolean cancelled = false;
++  
++          /** Serializes concurrent access to the cancelled field. */
++!         private Object cancel_mutex = new Object();
++  
++          /**
++           * Scheduling policy flag. <p>
++--- 671,677 ----
++          boolean cancelled = false;
++  
++          /** Serializes concurrent access to the cancelled field. */
++!         public Object cancel_mutex = new Object();
++  
++          /**
++           * Scheduling policy flag. <p>
++***************
++*** 801,807 ****
++       * Provides extensions to facilitate and simplify implementing
++       * timer functionality.
++       */
++!     protected static class TaskQueue extends HsqlArrayHeap {
++  
++          /**
++           * Constructs a new TaskQueue with the specified initial capacity and
++--- 801,807 ----
++       * Provides extensions to facilitate and simplify implementing
++       * timer functionality.
++       */
++!     public static class TaskQueue extends HsqlArrayHeap {
++  
++          /**
++           * Constructs a new TaskQueue with the specified initial capacity and
++diff -crN hsqldb-old/src/org/hsqldb/lib/IntKeyIntValueHashMap.java hsqldb/src/org/hsqldb/lib/IntKeyIntValueHashMap.java
++*** hsqldb-old/src/org/hsqldb/lib/IntKeyIntValueHashMap.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/IntKeyIntValueHashMap.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 42,49 ****
++   */
++  public class IntKeyIntValueHashMap extends BaseHashMap {
++  
++!     private Set        keySet;
++!     private Collection values;
++  
++      public IntKeyIntValueHashMap() {
++          this(16, 0.75f);
++--- 42,49 ----
++   */
++  public class IntKeyIntValueHashMap extends BaseHashMap {
++  
++!     public Set        keySet;
++!     public Collection values;
++  
++      public IntKeyIntValueHashMap() {
++          this(16, 0.75f);
++diff -crN hsqldb-old/src/org/hsqldb/lib/LongKeyIntValueHashMap.java hsqldb/src/org/hsqldb/lib/LongKeyIntValueHashMap.java
++*** hsqldb-old/src/org/hsqldb/lib/LongKeyIntValueHashMap.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/LongKeyIntValueHashMap.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 42,49 ****
++   */
++  public class LongKeyIntValueHashMap extends BaseHashMap {
++  
++!     private Set        keySet;
++!     private Collection values;
++  
++      public LongKeyIntValueHashMap() {
++          this(16, 0.75f);
++--- 42,49 ----
++   */
++  public class LongKeyIntValueHashMap extends BaseHashMap {
++  
++!     public Set        keySet;
++!     public Collection values;
++  
++      public LongKeyIntValueHashMap() {
++          this(16, 0.75f);
++diff -crN hsqldb-old/src/org/hsqldb/lib/MD5.java hsqldb/src/org/hsqldb/lib/MD5.java
++*** hsqldb-old/src/org/hsqldb/lib/MD5.java	2004-01-12 21:30:40.000000000 +0100
++--- hsqldb/src/org/hsqldb/lib/MD5.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 83,89 ****
++      /**
++       * The jce MD5 message digest generator.
++       */
++!     private static MessageDigest md5;
++  
++      /**
++       * Retrieves a hexidecimal character sequence representing the MD5
++--- 83,89 ----
++      /**
++       * The jce MD5 message digest generator.
++       */
++!     public static MessageDigest md5;
++  
++      /**
++       * Retrieves a hexidecimal character sequence representing the MD5
++diff -crN hsqldb-old/src/org/hsqldb/lib/SimpleLog.java hsqldb/src/org/hsqldb/lib/SimpleLog.java
++*** hsqldb-old/src/org/hsqldb/lib/SimpleLog.java	2007-10-11 11:32:18.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/SimpleLog.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 54,61 ****
++      public static int   LOG_NONE   = 0;
++      public static int   LOG_ERROR  = 1;
++      public static int   LOG_NORMAL = 2;
++!     private PrintWriter writer;
++!     private int         level;
++  
++      public SimpleLog(String path, int level, boolean useFile) {
++  
++--- 54,61 ----
++      public static int   LOG_NONE   = 0;
++      public static int   LOG_ERROR  = 1;
++      public static int   LOG_NORMAL = 2;
++!     public PrintWriter writer;
++!     public int         level;
++  
++      public SimpleLog(String path, int level, boolean useFile) {
++  
++***************
++*** 72,78 ****
++          }
++      }
++  
++!     private void makeLog(File file) {
++  
++          try {
++              FileUtil.getDefaultInstance().makeParentDirectories(file);
++--- 72,78 ----
++          }
++      }
++  
++!     public void makeLog(File file) {
++  
++          try {
++              FileUtil.getDefaultInstance().makeParentDirectories(file);
++diff -crN hsqldb-old/src/org/hsqldb/lib/Sort.java hsqldb/src/org/hsqldb/lib/Sort.java
++*** hsqldb-old/src/org/hsqldb/lib/Sort.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/Sort.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 146,152 ****
++      /**
++       * Swaps the a'th and b'th elements of the specified Row array.
++       */
++!     private static void swap(Object[] w, int a, int b) {
++  
++          Object t = w[a];
++  
++--- 146,152 ----
++      /**
++       * Swaps the a'th and b'th elements of the specified Row array.
++       */
++!     public static void swap(Object[] w, int a, int b) {
++  
++          Object t = w[a];
++  
++diff -crN hsqldb-old/src/org/hsqldb/lib/StopWatch.java hsqldb/src/org/hsqldb/lib/StopWatch.java
++*** hsqldb-old/src/org/hsqldb/lib/StopWatch.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/StopWatch.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 51,64 ****
++       * from stopped to running state, as reported
++       * by System.currentTimeMillis().
++       */
++!     private long startTime;
++!     private long lastStart;
++  
++      /**
++       * The accumulated running time of this object since
++       * it was last zeroed.
++       */
++!     private long total;
++  
++      /** Flags if this object is started or stopped. */
++      boolean running = false;
++--- 51,64 ----
++       * from stopped to running state, as reported
++       * by System.currentTimeMillis().
++       */
++!     public long startTime;
++!     public long lastStart;
++  
++      /**
++       * The accumulated running time of this object since
++       * it was last zeroed.
++       */
++!     public long total;
++  
++      /** Flags if this object is started or stopped. */
++      boolean running = false;
++diff -crN hsqldb-old/src/org/hsqldb/lib/StringConverter.java hsqldb/src/org/hsqldb/lib/StringConverter.java
++*** hsqldb-old/src/org/hsqldb/lib/StringConverter.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/StringConverter.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 87,98 ****
++  // fredt@users 20020328 - patch 1.7.0 by fredt - error trapping
++  public class StringConverter {
++  
++!     private static final byte[] HEXBYTES = {
++          (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4',
++          (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9',
++          (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f'
++      };
++!     private static final String HEXINDEX = "0123456789abcdef0123456789ABCDEF";
++  
++      /**
++       * Converts a String into a byte array by using a big-endian two byte
++--- 87,98 ----
++  // fredt@users 20020328 - patch 1.7.0 by fredt - error trapping
++  public class StringConverter {
++  
++!     public static final byte[] HEXBYTES = {
++          (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4',
++          (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9',
++          (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f'
++      };
++!     public static final String HEXINDEX = "0123456789abcdef0123456789ABCDEF";
++  
++      /**
++       * Converts a String into a byte array by using a big-endian two byte
++diff -crN hsqldb-old/src/org/hsqldb/lib/StringInputStream.java hsqldb/src/org/hsqldb/lib/StringInputStream.java
++*** hsqldb-old/src/org/hsqldb/lib/StringInputStream.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/StringInputStream.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 42,51 ****
++   */
++  public class StringInputStream extends InputStream {
++  
++!     protected int    strOffset  = 0;
++!     protected int    charOffset = 0;
++!     protected int    available;
++!     protected String str;
++  
++      public StringInputStream(String s) {
++          str       = s;
++--- 42,51 ----
++   */
++  public class StringInputStream extends InputStream {
++  
++!     public int    strOffset  = 0;
++!     public int    charOffset = 0;
++!     public int    available;
++!     public String str;
++  
++      public StringInputStream(String s) {
++          str       = s;
++diff -crN hsqldb-old/src/org/hsqldb/lib/WrapperIterator.java hsqldb/src/org/hsqldb/lib/WrapperIterator.java
++*** hsqldb-old/src/org/hsqldb/lib/WrapperIterator.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/WrapperIterator.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 46,62 ****
++   */
++  public class WrapperIterator implements Iterator {
++  
++!     private static final Object[] emptyelements = new Object[0];
++!     private Object[]              elements;
++!     private int                   i;
++  
++      // chained iterators
++!     private boolean  chained;
++!     private Iterator it1;
++!     private Iterator it2;
++  
++      /** return only not null elements */
++!     private boolean notNull;
++  
++      /**
++       * Constructor for an empty iterator. <p>
++--- 46,62 ----
++   */
++  public class WrapperIterator implements Iterator {
++  
++!     public static final Object[] emptyelements = new Object[0];
++!     public Object[]              elements;
++!     public int                   i;
++  
++      // chained iterators
++!     public boolean  chained;
++!     public Iterator it1;
++!     public Iterator it2;
++  
++      /** return only not null elements */
++!     public boolean notNull;
++  
++      /**
++       * Constructor for an empty iterator. <p>
++diff -crN hsqldb-old/src/org/hsqldb/lib/ZipUnzipFile.java hsqldb/src/org/hsqldb/lib/ZipUnzipFile.java
++*** hsqldb-old/src/org/hsqldb/lib/ZipUnzipFile.java	2006-07-15 22:58:02.000000000 +0200
++--- hsqldb/src/org/hsqldb/lib/ZipUnzipFile.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 86,92 ****
++   */
++  public class ZipUnzipFile {
++  
++!     private static final int COPY_BLOCK_SIZE = 1 << 16;
++  
++      public static void compressFile(String infilename, String outfilename,
++                                      FileAccess storage) throws IOException {
++--- 86,92 ----
++   */
++  public class ZipUnzipFile {
++  
++!     public static final int COPY_BLOCK_SIZE = 1 << 16;
++  
++      public static void compressFile(String infilename, String outfilename,
++                                      FileAccess storage) throws IOException {
++diff -crN hsqldb-old/src/org/hsqldb/Library.java hsqldb/src/org/hsqldb/Library.java
++*** hsqldb-old/src/org/hsqldb/Library.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/Library.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 291,297 ****
++          }
++      };
++  
++!     private Library() {}
++  
++      static HashMap getAliasMap() {
++  
++--- 291,297 ----
++          }
++      };
++  
++!     public Library() {}
++  
++      static HashMap getAliasMap() {
++  
++***************
++*** 305,318 ****
++          return h;
++      }
++  
++!     private static void register(HashMap h, String[][] s) {
++  
++          for (int i = 0; i < s.length; i++) {
++              h.put(s[i][0], s[i][1]);
++          }
++      }
++  
++!     private static final Random rRandom = new Random();
++  
++      // NUMERIC FUNCTIONS
++  // fredt@users 20020220 - patch 489184 by xclayl@users - thread safety
++--- 305,318 ----
++          return h;
++      }
++  
++!     public static void register(HashMap h, String[][] s) {
++  
++          for (int i = 0; i < s.length; i++) {
++              h.put(s[i][0], s[i][1]);
++          }
++      }
++  
++!     public static final Random rRandom = new Random();
++  
++      // NUMERIC FUNCTIONS
++  // fredt@users 20020220 - patch 489184 by xclayl@users - thread safety
++***************
++*** 361,367 ****
++      }
++  
++      // this magic number works for 100000000000000; but not for 0.1 and 0.01
++!     private static final double LOG10_FACTOR = 0.43429448190325183;
++  
++      /**
++       * Returns the base 10 logarithm of the given <code>double</code> value.
++--- 361,367 ----
++      }
++  
++      // this magic number works for 100000000000000; but not for 0.1 and 0.01
++!     public static final double LOG10_FACTOR = 0.43429448190325183;
++  
++      /**
++       * Returns the base 10 logarithm of the given <code>double</code> value.
++***************
++*** 1656,1662 ****
++       *           from this value to return the number of date-parts
++       *           between the two arguments.
++       */
++!     private static long getElapsed(int field, java.util.Date d1,
++                                     java.util.Date d2) {
++  
++          // can we do this very simply?
++--- 1656,1662 ----
++       *           from this value to return the number of date-parts
++       *           between the two arguments.
++       */
++!     public static long getElapsed(int field, java.util.Date d1,
++                                     java.util.Date d2) {
++  
++          // can we do this very simply?
++***************
++*** 1947,1953 ****
++  /** @todo  see bitxor and datediff numbering */
++  
++      //
++!     private static final IntValueHashMap functionMap =
++          new IntValueHashMap(67);
++      static final Double piValue = new Double(Library.pi());
++  
++--- 1947,1953 ----
++  /** @todo  see bitxor and datediff numbering */
++  
++      //
++!     public static final IntValueHashMap functionMap =
++          new IntValueHashMap(67);
++      static final Double piValue = new Double(Library.pi());
++  
++diff -crN hsqldb-old/src/org/hsqldb/Like.java hsqldb/src/org/hsqldb/Like.java
++*** hsqldb-old/src/org/hsqldb/Like.java	2005-10-23 21:25:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/Like.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 82,93 ****
++  // fredt@users 20031006 - patch 1.7.2 - reuse Like objects for all rows
++  class Like {
++  
++!     private char[]   cLike;
++!     private int[]    wildCardType;
++!     private int      iLen;
++!     private boolean  isIgnoreCase;
++!     private int      iFirstWildCard;
++!     private boolean  isNull;
++      Character        escapeChar;
++      boolean          hasCollation;
++      boolean          optimised;
++--- 82,93 ----
++  // fredt@users 20031006 - patch 1.7.2 - reuse Like objects for all rows
++  class Like {
++  
++!     public char[]   cLike;
++!     public int[]    wildCardType;
++!     public int      iLen;
++!     public boolean  isIgnoreCase;
++!     public int      iFirstWildCard;
++!     public boolean  isNull;
++      Character        escapeChar;
++      boolean          hasCollation;
++      boolean          optimised;
++***************
++*** 121,127 ****
++          normalize(session, s);
++      }
++  
++!     private String getStartsWith() {
++  
++          if (iLen == 0) {
++              return "";
++--- 121,127 ----
++          normalize(session, s);
++      }
++  
++!     public String getStartsWith() {
++  
++          if (iLen == 0) {
++              return "";
++***************
++*** 174,180 ****
++       *
++       * @return
++       */
++!     private boolean compareAt(String s, int i, int j, int jLen) {
++  
++          for (; i < iLen; i++) {
++              switch (wildCardType[i]) {
++--- 174,180 ----
++       *
++       * @return
++       */
++!     public boolean compareAt(String s, int i, int j, int jLen) {
++  
++          for (; i < iLen; i++) {
++              switch (wildCardType[i]) {
++***************
++*** 223,229 ****
++       * @param pattern
++       * @param b
++       */
++!     private void normalize(Session session, String pattern) {
++  
++          isNull = pattern == null;
++  
++--- 223,229 ----
++       * @param pattern
++       * @param b
++       */
++!     public void normalize(Session session, String pattern) {
++  
++          isNull = pattern == null;
++  
++diff -crN hsqldb-old/src/org/hsqldb/MemoryNode.java hsqldb/src/org/hsqldb/MemoryNode.java
++*** hsqldb-old/src/org/hsqldb/MemoryNode.java	2005-10-23 21:25:10.000000000 +0200
++--- hsqldb/src/org/hsqldb/MemoryNode.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 79,85 ****
++   */
++  class MemoryNode extends BaseMemoryNode {
++  
++!     protected Row rData;
++  
++      /**
++       *  A MemoreyNode is permenently linked with the row it refers to.
++--- 79,85 ----
++   */
++  class MemoryNode extends BaseMemoryNode {
++  
++!     public Row rData;
++  
++      /**
++       *  A MemoreyNode is permenently linked with the row it refers to.
++diff -crN hsqldb-old/src/org/hsqldb/NumberSequence.java hsqldb/src/org/hsqldb/NumberSequence.java
++*** hsqldb-old/src/org/hsqldb/NumberSequence.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/NumberSequence.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 45,59 ****
++      HsqlName name;
++  
++      // original start value - used in CREATE and ALTER commands
++!     private long startValue;
++  
++      // present value
++!     private long currValue;
++  
++      // last value
++!     private long lastValue;
++!     private long increment;
++!     private int  dataType;
++  
++      /**
++       * constructor with initial value and increment;
++--- 45,59 ----
++      HsqlName name;
++  
++      // original start value - used in CREATE and ALTER commands
++!     public long startValue;
++  
++      // present value
++!     public long currValue;
++  
++      // last value
++!     public long lastValue;
++!     public long increment;
++!     public int  dataType;
++  
++      /**
++       * constructor with initial value and increment;
++diff -crN hsqldb-old/src/org/hsqldb/Parser.java hsqldb/src/org/hsqldb/Parser.java
++*** hsqldb-old/src/org/hsqldb/Parser.java	2007-10-11 11:32:16.000000000 +0200
++--- hsqldb/src/org/hsqldb/Parser.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 125,145 ****
++   */
++  class Parser {
++  
++!     private Database  database;
++!     private Tokenizer tokenizer;
++!     private Session   session;
++!     private String    sSchema;
++!     private String    sTable;
++!     private String    sToken;
++!     private boolean   wasQuoted;
++!     private Object    oData;
++!     private int       iType;
++!     private int       iToken;
++!     private boolean   compilingView;
++  
++      //
++!     private int           subQueryLevel;
++!     private HsqlArrayList subQueryList = new HsqlArrayList();
++  
++      /**
++       *  Constructs a new Parser object with the given context.
++--- 125,145 ----
++   */
++  class Parser {
++  
++!     public Database  database;
++!     public Tokenizer tokenizer;
++!     public Session   session;
++!     public String    sSchema;
++!     public String    sTable;
++!     public String    sToken;
++!     public boolean   wasQuoted;
++!     public Object    oData;
++!     public int       iType;
++!     public int       iToken;
++!     public boolean   compilingView;
++  
++      //
++!     public int           subQueryLevel;
++!     public HsqlArrayList subQueryList = new HsqlArrayList();
++  
++      /**
++       *  Constructs a new Parser object with the given context.
++***************
++*** 778,784 ****
++  // in other RDBMS's
++  // "SELECT LIMIT n 0" discards the first n rows and returns the remaining rows
++  // fredt@users 20020225 - patch 456679 by hiep256 - TOP keyword
++!     private void parseLimit(String token, Select select,
++                              boolean isEnd) throws HsqlException {
++  
++          if (select.limitCondition != null) {
++--- 778,784 ----
++  // in other RDBMS's
++  // "SELECT LIMIT n 0" discards the first n rows and returns the remaining rows
++  // fredt@users 20020225 - patch 456679 by hiep256 - TOP keyword
++!     public void parseLimit(String token, Select select,
++                              boolean isEnd) throws HsqlException {
++  
++          if (select.limitCondition != null) {
++***************
++*** 857,863 ****
++          throw Trace.error(Trace.WRONG_DATA_TYPE, messageid);
++      }
++  
++!     private void parseOrderBy(Select select,
++                                HsqlArrayList vcolumn) throws HsqlException {
++  
++          String token;
++--- 857,863 ----
++          throw Trace.error(Trace.WRONG_DATA_TYPE, messageid);
++      }
++  
++!     public void parseOrderBy(Select select,
++                                HsqlArrayList vcolumn) throws HsqlException {
++  
++          String token;
++***************
++*** 887,893 ****
++          select.iOrderLen = len;
++      }
++  
++!     private void resolveSelectTableFilter(Select select,
++                                            HsqlArrayList vcolumn,
++                                            HsqlArrayList vfilter)
++                                            throws HsqlException {
++--- 887,893 ----
++          select.iOrderLen = len;
++      }
++  
++!     public void resolveSelectTableFilter(Select select,
++                                            HsqlArrayList vcolumn,
++                                            HsqlArrayList vfilter)
++                                            throws HsqlException {
++***************
++*** 1023,1029 ****
++       * @throws HsqlException if an ambiguous reference to an alias or
++       *      non-integer column index is encountered
++       */
++!     private static Expression resolveOrderByExpression(Expression e,
++              Select select, HsqlArrayList vcolumn) throws HsqlException {
++  
++          int     visiblecols = select.iResultLen;
++--- 1023,1029 ----
++       * @throws HsqlException if an ambiguous reference to an alias or
++       *      non-integer column index is encountered
++       */
++!     public static Expression resolveOrderByExpression(Expression e,
++              Select select, HsqlArrayList vcolumn) throws HsqlException {
++  
++          int     visiblecols = select.iResultLen;
++***************
++*** 1067,1073 ****
++          return e;
++      }
++  
++!     private static Expression resolveOrderByColumnIndex(Expression e,
++              HsqlArrayList vcolumn, int visiblecols) throws HsqlException {
++  
++          // order by 1,2,3
++--- 1067,1073 ----
++          return e;
++      }
++  
++!     public static Expression resolveOrderByColumnIndex(Expression e,
++              HsqlArrayList vcolumn, int visiblecols) throws HsqlException {
++  
++          // order by 1,2,3
++***************
++*** 1086,1092 ****
++          throw Trace.error(Trace.INVALID_ORDER_BY);
++      }
++  
++!     private TableFilter parseSimpleTableFilter(int type) throws HsqlException {
++  
++          String alias  = null;
++          String token  = tokenizer.getName();
++--- 1086,1092 ----
++          throw Trace.error(Trace.INVALID_ORDER_BY);
++      }
++  
++!     public TableFilter parseSimpleTableFilter(int type) throws HsqlException {
++  
++          String alias  = null;
++          String token  = tokenizer.getName();
++***************
++*** 1117,1123 ****
++       * @return a newly constructed TableFilter object
++       * @throws  HsqlException if a parsing error occurs
++       */
++!     private TableFilter parseTableFilter(boolean outerjoin)
++      throws HsqlException {
++  
++          Table          t          = null;
++--- 1117,1123 ----
++       * @return a newly constructed TableFilter object
++       * @throws  HsqlException if a parsing error occurs
++       */
++!     public TableFilter parseTableFilter(boolean outerjoin)
++      throws HsqlException {
++  
++          Table          t          = null;
++***************
++*** 1200,1206 ****
++       * @param  e2
++       * @return
++       */
++!     private static Expression addCondition(Expression e1, Expression e2) {
++  
++          if (e1 == null) {
++              return e2;
++--- 1200,1206 ----
++       * @param  e2
++       * @return
++       */
++!     public static Expression addCondition(Expression e1, Expression e2) {
++  
++          if (e1 == null) {
++              return e2;
++***************
++*** 1224,1230 ****
++       *      in the join
++       * @return a new Expression object; the conjunction of e1 and e2
++       */
++!     private static Expression addJoinCondition(Expression e1, Expression e2,
++              TableFilter tf, boolean outer) throws HsqlException {
++  
++          if (!e2.setForJoin(tf, outer)) {
++--- 1224,1230 ----
++       *      in the join
++       * @return a new Expression object; the conjunction of e1 and e2
++       */
++!     public static Expression addJoinCondition(Expression e1, Expression e2,
++              TableFilter tf, boolean outer) throws HsqlException {
++  
++          if (!e2.setForJoin(tf, outer)) {
++***************
++*** 1251,1257 ****
++          return r;
++      }
++  
++!     private Expression readAggregate() throws HsqlException {
++  
++          boolean distinct = false;
++          boolean all      = false;
++--- 1251,1257 ----
++          return r;
++      }
++  
++!     public Expression readAggregate() throws HsqlException {
++  
++          boolean distinct = false;
++          boolean all      = false;
++***************
++*** 1296,1302 ****
++       * @return a disjuntion, possibly degenerate
++       * @throws  HsqlException
++       */
++!     private Expression readOr() throws HsqlException {
++  
++          Expression r = readAnd();
++  
++--- 1296,1302 ----
++       * @return a disjuntion, possibly degenerate
++       * @throws  HsqlException
++       */
++!     public Expression readOr() throws HsqlException {
++  
++          Expression r = readAnd();
++  
++***************
++*** 1318,1324 ****
++       * @return a conjunction, possibly degenerate
++       * @throws  HsqlException
++       */
++!     private Expression readAnd() throws HsqlException {
++  
++          Expression r = readCondition();
++  
++--- 1318,1324 ----
++       * @return a conjunction, possibly degenerate
++       * @throws  HsqlException
++       */
++!     public Expression readAnd() throws HsqlException {
++  
++          Expression r = readCondition();
++  
++***************
++*** 1340,1346 ****
++       * @return a predicate, possibly composite
++       * @throws  HsqlException
++       */
++!     private Expression readCondition() throws HsqlException {
++  
++          switch (iToken) {
++  
++--- 1340,1346 ----
++       * @return a predicate, possibly composite
++       * @throws  HsqlException
++       */
++!     public Expression readCondition() throws HsqlException {
++  
++          switch (iToken) {
++  
++***************
++*** 1457,1463 ****
++          }
++      }
++  
++!     private Expression parseLikePredicate(Expression a) throws HsqlException {
++  
++          read();
++  
++--- 1457,1463 ----
++          }
++      }
++  
++!     public Expression parseLikePredicate(Expression a) throws HsqlException {
++  
++          read();
++  
++***************
++*** 1494,1500 ****
++          return a;
++      }
++  
++!     private Expression parseBetweenPredicate(Expression a)
++      throws HsqlException {
++  
++          read();
++--- 1494,1500 ----
++          return a;
++      }
++  
++!     public Expression parseBetweenPredicate(Expression a)
++      throws HsqlException {
++  
++          read();
++***************
++*** 1520,1526 ****
++          return new Expression(Expression.AND, l, h);
++      }
++  
++!     private Expression parseInPredicate(Expression a) throws HsqlException {
++  
++          int type = iToken;
++  
++--- 1520,1526 ----
++          return new Expression(Expression.AND, l, h);
++      }
++  
++!     public Expression parseInPredicate(Expression a) throws HsqlException {
++  
++          int type = iToken;
++  
++***************
++*** 1578,1584 ****
++          return new Expression(type, a, b);
++      }
++  
++!     private Expression parseAllAnyPredicate() throws HsqlException {
++  
++          int type = iToken;
++  
++--- 1578,1584 ----
++          return new Expression(type, a, b);
++      }
++  
++!     public Expression parseAllAnyPredicate() throws HsqlException {
++  
++          int type = iToken;
++  
++***************
++*** 1618,1624 ****
++       * @param  type
++       * @throws  HsqlException
++       */
++!     private void readThis(int type) throws HsqlException {
++          Trace.check(iToken == type, Trace.UNEXPECTED_TOKEN);
++          read();
++      }
++--- 1618,1624 ----
++       * @param  type
++       * @throws  HsqlException
++       */
++!     public void readThis(int type) throws HsqlException {
++          Trace.check(iToken == type, Trace.UNEXPECTED_TOKEN);
++          read();
++      }
++***************
++*** 1629,1635 ****
++       * @return a concatenation, possibly degenerate
++       * @throws  HsqlException
++       */
++!     private Expression readConcat() throws HsqlException {
++  
++          Expression r = readSum();
++  
++--- 1629,1635 ----
++       * @return a concatenation, possibly degenerate
++       * @throws  HsqlException
++       */
++!     public Expression readConcat() throws HsqlException {
++  
++          Expression r = readSum();
++  
++***************
++*** 1666,1672 ****
++       * @return  a summation, possibly degenerate
++       * @throws  HsqlException
++       */
++!     private Expression readSum() throws HsqlException {
++  
++          Expression r = readFactor();
++  
++--- 1666,1672 ----
++       * @return  a summation, possibly degenerate
++       * @throws  HsqlException
++       */
++!     public Expression readSum() throws HsqlException {
++  
++          Expression r = readFactor();
++  
++***************
++*** 1697,1703 ****
++       * @return  a product, possibly degenerate
++       * @throws  HsqlException
++       */
++!     private Expression readFactor() throws HsqlException {
++  
++          Expression r = readTerm();
++  
++--- 1697,1703 ----
++       * @return  a product, possibly degenerate
++       * @throws  HsqlException
++       */
++!     public Expression readFactor() throws HsqlException {
++  
++          Expression r = readTerm();
++  
++***************
++*** 1719,1725 ****
++       * @return  a term, possibly composite
++       * @throws  HsqlException
++       */
++!     private Expression readTerm() throws HsqlException {
++  
++          Expression r = null;
++  
++--- 1719,1725 ----
++       * @return  a term, possibly composite
++       * @throws  HsqlException
++       */
++!     public Expression readTerm() throws HsqlException {
++  
++          Expression r = null;
++  
++***************
++*** 1895,1901 ****
++      /**
++       * Reads part of a CASE .. WHEN  expression
++       */
++!     private Expression parseCaseWhen(Expression r) throws HsqlException {
++  
++          readThis(Expression.WHEN);
++  
++--- 1895,1901 ----
++      /**
++       * Reads part of a CASE .. WHEN  expression
++       */
++!     public Expression parseCaseWhen(Expression r) throws HsqlException {
++  
++          readThis(Expression.WHEN);
++  
++***************
++*** 1921,1927 ****
++      /**
++       * reads a CASEWHEN expression
++       */
++!     private Expression readCaseWhenExpression() throws HsqlException {
++  
++          int        type = iToken;
++          Expression r    = null;
++--- 1921,1927 ----
++      /**
++       * reads a CASEWHEN expression
++       */
++!     public Expression readCaseWhenExpression() throws HsqlException {
++  
++          int        type = iToken;
++          Expression r    = null;
++***************
++*** 1949,1955 ****
++      /**
++       * Reads a CAST or CONVERT expression
++       */
++!     private Expression readCastExpression() throws HsqlException {
++  
++          boolean isConvert = iToken == Expression.CONVERT;
++  
++--- 1949,1955 ----
++      /**
++       * Reads a CAST or CONVERT expression
++       */
++!     public Expression readCastExpression() throws HsqlException {
++  
++          boolean isConvert = iToken == Expression.CONVERT;
++  
++***************
++*** 2009,2015 ****
++      /**
++       * reads a Column or Function expression
++       */
++!     private Expression readColumnExpression() throws HsqlException {
++  
++          String     name = sToken;
++          Expression r    = new Expression(sTable, name, wasQuoted);
++--- 2009,2015 ----
++      /**
++       * reads a Column or Function expression
++       */
++!     public Expression readColumnExpression() throws HsqlException {
++  
++          String     name = sToken;
++          Expression r    = new Expression(sTable, name, wasQuoted);
++***************
++*** 2058,2064 ****
++      /**
++       * reads a CONCAT expression
++       */
++!     private Expression readConcatExpression() throws HsqlException {
++  
++          int type = iToken;
++  
++--- 2058,2064 ----
++      /**
++       * reads a CONCAT expression
++       */
++!     public Expression readConcatExpression() throws HsqlException {
++  
++          int type = iToken;
++  
++***************
++*** 2079,2085 ****
++      /**
++       * Reads a NULLIF expression
++       */
++!     private Expression readNullIfExpression() throws HsqlException {
++  
++          // turn into a CASEWHEN
++          read();
++--- 2079,2085 ----
++      /**
++       * Reads a NULLIF expression
++       */
++!     public Expression readNullIfExpression() throws HsqlException {
++  
++          // turn into a CASEWHEN
++          read();
++***************
++*** 2104,2110 ****
++      /**
++       * Reads a COALESE or IFNULL expression
++       */
++!     private Expression readCoalesceExpression() throws HsqlException {
++  
++          Expression r = null;
++  
++--- 2104,2110 ----
++      /**
++       * Reads a COALESE or IFNULL expression
++       */
++!     public Expression readCoalesceExpression() throws HsqlException {
++  
++          Expression r = null;
++  
++***************
++*** 2148,2154 ****
++      /**
++       * Reads an EXTRACT expression
++       */
++!     private Expression readExtractExpression() throws HsqlException {
++  
++          read();
++          readThis(Expression.OPEN);
++--- 2148,2154 ----
++      /**
++       * Reads an EXTRACT expression
++       */
++!     public Expression readExtractExpression() throws HsqlException {
++  
++          read();
++          readThis(Expression.OPEN);
++***************
++*** 2175,2181 ****
++      /**
++       * Reads a POSITION expression
++       */
++!     private Expression readPositionExpression() throws HsqlException {
++  
++          read();
++          readThis(Expression.OPEN);
++--- 2175,2181 ----
++      /**
++       * Reads a POSITION expression
++       */
++!     public Expression readPositionExpression() throws HsqlException {
++  
++          read();
++          readThis(Expression.OPEN);
++***************
++*** 2194,2200 ****
++      /**
++       * Reads a SUBSTRING expression
++       */
++!     private Expression readSubstringExpression() throws HsqlException {
++  
++          boolean commas = false;
++  
++--- 2194,2200 ----
++      /**
++       * Reads a SUBSTRING expression
++       */
++!     public Expression readSubstringExpression() throws HsqlException {
++  
++          boolean commas = false;
++  
++***************
++*** 2235,2241 ****
++          return new Expression(f);
++      }
++  
++!     private Expression readSequenceExpression() throws HsqlException {
++  
++          tokenizer.getThis(Token.T_VALUE);
++          tokenizer.getThis(Token.T_FOR);
++--- 2235,2241 ----
++          return new Expression(f);
++      }
++  
++!     public Expression readSequenceExpression() throws HsqlException {
++  
++          tokenizer.getThis(Token.T_VALUE);
++          tokenizer.getThis(Token.T_FOR);
++***************
++*** 2259,2265 ****
++      /**
++       * Reads a TRIM expression
++       */
++!     private Expression readTrimExpression() throws HsqlException {
++  
++          read();
++          readThis(Expression.OPEN);
++--- 2259,2265 ----
++      /**
++       * Reads a TRIM expression
++       */
++!     public Expression readTrimExpression() throws HsqlException {
++  
++          read();
++          readThis(Expression.OPEN);
++***************
++*** 2373,2379 ****
++       *
++       * @throws  HsqlException
++       */
++!     private void read() throws HsqlException {
++  
++          sToken    = tokenizer.getString();
++          wasQuoted = tokenizer.wasQuotedIdentifier();
++--- 2373,2379 ----
++       *
++       * @throws  HsqlException
++       */
++!     public void read() throws HsqlException {
++  
++          sToken    = tokenizer.getString();
++          wasQuoted = tokenizer.wasQuotedIdentifier();
++***************
++*** 2485,2496 ****
++       *
++       * @throws HsqlException if a tokenization error occurs
++       */
++!     private void readToken() throws HsqlException {
++          sToken = tokenizer.getString();
++          iToken = tokenSet.get(sToken, -1);
++      }
++  
++!     private static IntValueHashMap tokenSet = new IntValueHashMap(37);
++  
++      static {
++          tokenSet.put(Token.T_COMMA, Expression.COMMA);
++--- 2485,2496 ----
++       *
++       * @throws HsqlException if a tokenization error occurs
++       */
++!     public void readToken() throws HsqlException {
++          sToken = tokenizer.getString();
++          iToken = tokenSet.get(sToken, -1);
++      }
++  
++!     public static IntValueHashMap tokenSet = new IntValueHashMap(37);
++  
++      static {
++          tokenSet.put(Token.T_COMMA, Expression.COMMA);
++***************
++*** 2556,2563 ****
++  // boucherb@users 20030411 - patch 1.7.2 - for prepared statements
++  // ---------------------------------------------------------------
++      HsqlArrayList                     parameters   = new HsqlArrayList();
++!     private static final Expression[] noParameters = new Expression[0];
++!     private static final SubQuery[]   noSubqueries = new SubQuery[0];
++  
++      /**
++       *  Destructive get method
++--- 2556,2563 ----
++  // boucherb@users 20030411 - patch 1.7.2 - for prepared statements
++  // ---------------------------------------------------------------
++      HsqlArrayList                     parameters   = new HsqlArrayList();
++!     public static final Expression[] noParameters = new Expression[0];
++!     public static final SubQuery[]   noSubqueries = new SubQuery[0];
++  
++      /**
++       *  Destructive get method
++***************
++*** 2656,2662 ****
++          return cs;
++      }
++  
++!     private void getInsertColumnValueExpressions(Table t, Expression[] acve,
++              int len) throws HsqlException {
++  
++          tokenizer.getThis(Token.T_OPENBRACKET);
++--- 2656,2662 ----
++          return cs;
++      }
++  
++!     public void getInsertColumnValueExpressions(Table t, Expression[] acve,
++              int len) throws HsqlException {
++  
++          tokenizer.getThis(Token.T_OPENBRACKET);
++diff -crN hsqldb-old/src/org/hsqldb/persist/Cache.java hsqldb/src/org/hsqldb/persist/Cache.java
++*** hsqldb-old/src/org/hsqldb/persist/Cache.java	2006-09-22 15:14:04.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/Cache.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 54,68 ****
++  public class Cache {
++  
++      final DataFileCache                  dataFileCache;
++!     private int                          capacity;         // number of Rows
++!     private long                         bytesCapacity;    // number of bytes
++!     private final CachedObjectComparator rowComparator;
++  
++  //
++!     private CachedObject[] rowTable;
++  
++  //
++!     private final ObjectCacheHashMap cacheMap;
++      long                             cacheBytesLength;
++  
++      // for testing
++--- 54,68 ----
++  public class Cache {
++  
++      final DataFileCache                  dataFileCache;
++!     public int                          capacity;         // number of Rows
++!     public long                         bytesCapacity;    // number of bytes
++!     public final CachedObjectComparator rowComparator;
++  
++  //
++!     public CachedObject[] rowTable;
++  
++  //
++!     public final ObjectCacheHashMap cacheMap;
++      long                             cacheBytesLength;
++  
++      // for testing
++***************
++*** 148,154 ****
++       * in the cache.
++       *
++       */
++!     private synchronized void cleanUp() throws IOException {
++  
++          int removeCount = cacheMap.size() / 2;
++          int accessTarget = cacheMap.getAccessCountCeiling(removeCount,
++--- 148,154 ----
++       * in the cache.
++       *
++       */
++!     public synchronized void cleanUp() throws IOException {
++  
++          int removeCount = cacheMap.size() / 2;
++          int accessTarget = cacheMap.getAccessCountCeiling(removeCount,
++***************
++*** 176,182 ****
++          saveRows(savecount);
++      }
++  
++!     private synchronized void saveRows(int count) throws IOException {
++  
++          if (count == 0) {
++              return;
++--- 176,182 ----
++          saveRows(savecount);
++      }
++  
++!     public synchronized void saveRows(int count) throws IOException {
++  
++          if (count == 0) {
++              return;
++***************
++*** 246,252 ****
++          static final int COMPARE_LAST_ACCESS = 0;
++          static final int COMPARE_POSITION    = 1;
++          static final int COMPARE_SIZE        = 2;
++!         private int      compareType;
++  
++          CachedObjectComparator() {}
++  
++--- 246,252 ----
++          static final int COMPARE_LAST_ACCESS = 0;
++          static final int COMPARE_POSITION    = 1;
++          static final int COMPARE_SIZE        = 2;
++!         public int      compareType;
++  
++          CachedObjectComparator() {}
++  
++diff -crN hsqldb-old/src/org/hsqldb/persist/DataFileBlockManager.java hsqldb/src/org/hsqldb/persist/DataFileBlockManager.java
++*** hsqldb-old/src/org/hsqldb/persist/DataFileBlockManager.java	2006-09-22 15:14:04.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/DataFileBlockManager.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 42,54 ****
++   */
++  public class DataFileBlockManager {
++  
++!     private DoubleIntIndex lookup;
++!     private final int      capacity;
++!     private int            midSize;
++!     private final int      scale;
++!     private long           releaseCount;
++!     private long           requestCount;
++!     private long           requestSize;
++  
++      // reporting vars
++      long    lostFreeBlockSize;
++--- 42,54 ----
++   */
++  public class DataFileBlockManager {
++  
++!     public DoubleIntIndex lookup;
++!     public final int      capacity;
++!     public int            midSize;
++!     public final int      scale;
++!     public long           releaseCount;
++!     public long           requestCount;
++!     public long           requestSize;
++  
++      // reporting vars
++      long    lostFreeBlockSize;
++***************
++*** 144,150 ****
++          removeBlocks(lookup.size());
++      }
++  
++!     private void resetList() {
++  
++          if (requestCount != 0) {
++              midSize = (int) (requestSize / requestCount);
++--- 144,150 ----
++          removeBlocks(lookup.size());
++      }
++  
++!     public void resetList() {
++  
++          if (requestCount != 0) {
++              midSize = (int) (requestSize / requestCount);
++***************
++*** 159,165 ****
++          removeBlocks(first);
++      }
++  
++!     private void removeBlocks(int blocks) {
++  
++          for (int i = 0; i < blocks; i++) {
++              lostFreeBlockSize += lookup.getValue(i);
++--- 159,165 ----
++          removeBlocks(first);
++      }
++  
++!     public void removeBlocks(int blocks) {
++  
++          for (int i = 0; i < blocks; i++) {
++              lostFreeBlockSize += lookup.getValue(i);
++***************
++*** 168,172 ****
++          lookup.removeRange(0, blocks);
++      }
++  
++!     private void checkIntegrity() throws NullPointerException {}
++  }
++--- 168,172 ----
++          lookup.removeRange(0, blocks);
++      }
++  
++!     public void checkIntegrity() throws NullPointerException {}
++  }
++diff -crN hsqldb-old/src/org/hsqldb/persist/DataFileCache.java hsqldb/src/org/hsqldb/persist/DataFileCache.java
++*** hsqldb-old/src/org/hsqldb/persist/DataFileCache.java	2007-10-11 11:32:18.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/DataFileCache.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 63,69 ****
++   */
++  public class DataFileCache {
++  
++!     protected FileAccess fa;
++  
++      // flags
++      public static final int FLAG_ISSAVED = 2;
++--- 63,69 ----
++   */
++  public class DataFileCache {
++  
++!     public FileAccess fa;
++  
++      // flags
++      public static final int FLAG_ISSAVED = 2;
++***************
++*** 78,118 ****
++  
++      //
++      DataFileBlockManager     freeBlocks;
++!     private static final int initIOBufferSize = 256;
++  
++      //
++!     protected String   fileName;
++!     protected String   backupFileName;
++!     protected Database database;
++  
++      // this flag is used externally to determine if a backup is required
++!     protected boolean fileModified;
++!     protected int     cacheFileScale;
++  
++      // post openning constant fields
++!     protected boolean cacheReadonly;
++  
++      // cache operation mode
++!     protected boolean storeOnInsert;
++  
++      //
++!     protected int     cachedRowPadding = 8;
++!     protected boolean hasRowInfo       = false;
++  
++      // reusable input / output streams
++!     protected RowInputInterface  rowIn;
++!     protected RowOutputInterface rowOut;
++  
++      //
++      public long maxDataFileSize;
++  
++      //
++!     protected Storage dataFile;
++!     protected long    fileFreePosition;
++!     protected int     maxCacheSize;                // number of Rows
++!     protected long    maxCacheBytes;               // number of bytes
++!     protected int     maxFreeBlocks;
++!     protected Cache   cache;
++  
++      public DataFileCache(Database db,
++                           String baseFileName) throws HsqlException {
++--- 78,118 ----
++  
++      //
++      DataFileBlockManager     freeBlocks;
++!     public static final int initIOBufferSize = 256;
++  
++      //
++!     public String   fileName;
++!     public String   backupFileName;
++!     public Database database;
++  
++      // this flag is used externally to determine if a backup is required
++!     public boolean fileModified;
++!     public int     cacheFileScale;
++  
++      // post openning constant fields
++!     public boolean cacheReadonly;
++  
++      // cache operation mode
++!     public boolean storeOnInsert;
++  
++      //
++!     public int     cachedRowPadding = 8;
++!     public boolean hasRowInfo       = false;
++  
++      // reusable input / output streams
++!     public RowInputInterface  rowIn;
++!     public RowOutputInterface rowOut;
++  
++      //
++      public long maxDataFileSize;
++  
++      //
++!     public Storage dataFile;
++!     public long    fileFreePosition;
++!     public int     maxCacheSize;                // number of Rows
++!     public long    maxCacheBytes;               // number of bytes
++!     public int     maxFreeBlocks;
++!     public Cache   cache;
++  
++      public DataFileCache(Database db,
++                           String baseFileName) throws HsqlException {
++***************
++*** 125,131 ****
++      /**
++       * initial external parameters are set here.
++       */
++!     protected void initParams(Database database,
++                                String baseFileName) throws HsqlException {
++  
++          HsqlDatabaseProperties props = database.getProperties();
++--- 125,131 ----
++      /**
++       * initial external parameters are set here.
++       */
++!     public void initParams(Database database,
++                                String baseFileName) throws HsqlException {
++  
++          HsqlDatabaseProperties props = database.getProperties();
++***************
++*** 364,370 ****
++          }
++      }
++  
++!     protected void initBuffers() {
++  
++          if (rowOut == null
++                  || ((RowOutputBinary) rowOut).getBuffer().length
++--- 364,370 ----
++          }
++      }
++  
++!     public void initBuffers() {
++  
++          if (rowOut == null
++                  || ((RowOutputBinary) rowOut).getBuffer().length
++***************
++*** 453,459 ****
++       * Free space is requested from the block manager if it exists.
++       * Otherwise the file is grown to accommodate it.
++       */
++!     private int setFilePos(CachedObject r) throws IOException {
++  
++          int rowSize = r.getStorageSize();
++          int i       = freeBlocks == null ? -1
++--- 453,459 ----
++       * Free space is requested from the block manager if it exists.
++       * Otherwise the file is grown to accommodate it.
++       */
++!     public int setFilePos(CachedObject r) throws IOException {
++  
++          int rowSize = r.getStorageSize();
++          int i       = freeBlocks == null ? -1
++***************
++*** 568,581 ****
++          return readObject(i);
++      }
++  
++!     protected synchronized int readSize(int pos) throws IOException {
++  
++          dataFile.seek((long) pos * cacheFileScale);
++  
++          return dataFile.readInt();
++      }
++  
++!     protected synchronized RowInputInterface readObject(int pos)
++      throws IOException {
++  
++          dataFile.seek((long) pos * cacheFileScale);
++--- 568,581 ----
++          return readObject(i);
++      }
++  
++!     public synchronized int readSize(int pos) throws IOException {
++  
++          dataFile.seek((long) pos * cacheFileScale);
++  
++          return dataFile.readInt();
++      }
++  
++!     public synchronized RowInputInterface readObject(int pos)
++      throws IOException {
++  
++          dataFile.seek((long) pos * cacheFileScale);
++***************
++*** 592,598 ****
++          return cache.release(i);
++      }
++  
++!     protected synchronized void saveRows(CachedObject[] rows, int offset,
++                                           int count) throws IOException {
++  
++          try {
++--- 592,598 ----
++          return cache.release(i);
++      }
++  
++!     public synchronized void saveRows(CachedObject[] rows, int offset,
++                                           int count) throws IOException {
++  
++          try {
++***************
++*** 771,777 ****
++          return fileModified;
++      }
++  
++!     protected synchronized void setFileModified() throws IOException {
++  
++          if (!fileModified) {
++  
++--- 771,777 ----
++          return fileModified;
++      }
++  
++!     public synchronized void setFileModified() throws IOException {
++  
++          if (!fileModified) {
++  
++diff -crN hsqldb-old/src/org/hsqldb/persist/HsqlDatabaseProperties.java hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java
++*** hsqldb-old/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2007-10-22 22:37:50.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 55,63 ****
++   */
++  public class HsqlDatabaseProperties extends HsqlProperties {
++  
++!     private static String hsqldb-old_method_class_names =
++          "hsqldb.method_class_names";
++!     private static HashSet accessibleJavaMethodNames;
++  
++      static {
++          try {
++--- 55,63 ----
++   */
++  public class HsqlDatabaseProperties extends HsqlProperties {
++  
++!     public static String hsqldb-old_method_class_names =
++          "hsqldb.method_class_names";
++!     public static HashSet accessibleJavaMethodNames;
++  
++      static {
++          try {
++***************
++*** 139,158 ****
++      public static final int indexLimit        = 8;
++  
++      // accessibility
++!     private static final int SET_PROPERTY  = 0;
++!     private static final int SQL_PROPERTY  = 1;
++!     private static final int FILE_PROPERTY = 2;
++  
++      // db files modified
++      public static final int     FILES_NOT_MODIFIED = 0;
++      public static final int     FILES_MODIFIED     = 1;
++      public static final int     FILES_NEW          = 2;
++!     private static final String MODIFIED_NO        = "no";
++!     private static final String MODIFIED_YES       = "yes";
++!     private static final String MODIFIED_NEW       = "no-new-files";
++  
++      // allowed property metadata
++!     private static HashMap meta = new HashMap();
++  
++      // versions
++      public static final String VERSION_STRING_1_7_0     = "1.7.0";
++--- 139,158 ----
++      public static final int indexLimit        = 8;
++  
++      // accessibility
++!     public static final int SET_PROPERTY  = 0;
++!     public static final int SQL_PROPERTY  = 1;
++!     public static final int FILE_PROPERTY = 2;
++  
++      // db files modified
++      public static final int     FILES_NOT_MODIFIED = 0;
++      public static final int     FILES_MODIFIED     = 1;
++      public static final int     FILES_NEW          = 2;
++!     public static final String MODIFIED_NO        = "no";
++!     public static final String MODIFIED_YES       = "yes";
++!     public static final String MODIFIED_NEW       = "no-new-files";
++  
++      // allowed property metadata
++!     public static HashMap meta = new HashMap();
++  
++      // versions
++      public static final String VERSION_STRING_1_7_0     = "1.7.0";
++***************
++*** 168,178 ****
++  
++      //
++      public static final String  db_version  = "version";
++!     private static final String db_readonly = "readonly";
++!     private static final String db_modified = "modified";
++  
++      //
++!     private static final String runtime_gc_interval = "runtime.gc_interval";
++      public static final String  hsqldb-old_applog       = "hsqldb.applog";
++      public static final String hsqldb-old_cache_file_scale =
++          "hsqldb.cache_file_scale";
++--- 168,178 ----
++  
++      //
++      public static final String  db_version  = "version";
++!     public static final String db_readonly = "readonly";
++!     public static final String db_modified = "modified";
++  
++      //
++!     public static final String runtime_gc_interval = "runtime.gc_interval";
++      public static final String  hsqldb-old_applog       = "hsqldb.applog";
++      public static final String hsqldb-old_cache_file_scale =
++          "hsqldb.cache_file_scale";
++***************
++*** 182,208 ****
++      public static final String hsqldb-old_cache_size_scale =
++          "hsqldb.cache_size_scale";
++      public static final String  hsqldb-old_cache_version = "hsqldb.cache_version";
++!     private static final String hsqldb-old_catalogs      = "hsqldb.catalogs";
++      public static final String hsqldb-old_compatible_version =
++          "hsqldb.compatible_version";
++      public static final String hsqldb-old_default_table_type =
++          "hsqldb.default_table_type";
++      public static final String hsqldb-old_defrag_limit = "hsqldb.defrag_limit";
++!     private static final String hsqldb-old_files_readonly =
++          "hsqldb.files_readonly";
++      public static final String hsqldb-old_log_size      = "hsqldb.log_size";
++      public static final String hsqldb-old_nio_data_file = "hsqldb.nio_data_file";
++      public static final String hsqldb-old_max_nio_scale = "hsqldb.max_nio_scale";
++      public static final String hsqldb-old_raf_buffer_scale =
++          "hsqldb.raf_buffer_scale";
++!     private static final String hsqldb-old_original_version =
++          "hsqldb.original_version";
++      public static final String hsqldb-old_script_format = "hsqldb.script_format";
++  
++      //
++!     private static final String sql_compare_in_locale =
++          "sql.compare_in_locale";
++!     private static final String sql_enforce_strict_size =
++          "sql.enforce_strict_size";
++      public static final String sql_tx_no_multi_write =
++          "sql.tx_no_multi_rewrite";
++--- 182,208 ----
++      public static final String hsqldb-old_cache_size_scale =
++          "hsqldb.cache_size_scale";
++      public static final String  hsqldb-old_cache_version = "hsqldb.cache_version";
++!     public static final String hsqldb-old_catalogs      = "hsqldb.catalogs";
++      public static final String hsqldb-old_compatible_version =
++          "hsqldb.compatible_version";
++      public static final String hsqldb-old_default_table_type =
++          "hsqldb.default_table_type";
++      public static final String hsqldb-old_defrag_limit = "hsqldb.defrag_limit";
++!     public static final String hsqldb-old_files_readonly =
++          "hsqldb.files_readonly";
++      public static final String hsqldb-old_log_size      = "hsqldb.log_size";
++      public static final String hsqldb-old_nio_data_file = "hsqldb.nio_data_file";
++      public static final String hsqldb-old_max_nio_scale = "hsqldb.max_nio_scale";
++      public static final String hsqldb-old_raf_buffer_scale =
++          "hsqldb.raf_buffer_scale";
++!     public static final String hsqldb-old_original_version =
++          "hsqldb.original_version";
++      public static final String hsqldb-old_script_format = "hsqldb.script_format";
++  
++      //
++!     public static final String sql_compare_in_locale =
++          "sql.compare_in_locale";
++!     public static final String sql_enforce_strict_size =
++          "sql.enforce_strict_size";
++      public static final String sql_tx_no_multi_write =
++          "sql.tx_no_multi_rewrite";
++***************
++*** 223,229 ****
++  
++      static {
++  
++!         // string defaults for protected props
++          meta.put(db_version, getMeta(db_version, FILE_PROPERTY, null));
++          meta.put(hsqldb_compatible_version,
++                   getMeta(hsqldb_compatible_version, FILE_PROPERTY, null));
++--- 223,229 ----
++  
++      static {
++  
++!         // string defaults for public props
++          meta.put(db_version, getMeta(db_version, FILE_PROPERTY, null));
++          meta.put(hsqldb_compatible_version,
++                   getMeta(hsqldb_compatible_version, FILE_PROPERTY, null));
++***************
++*** 242,248 ****
++          meta.put(textdb_encoding,
++                   getMeta(textdb_encoding, SET_PROPERTY, null));
++  
++!         // boolean defaults for protected props
++          meta.put(db_readonly, getMeta(db_readonly, FILE_PROPERTY, false));
++          meta.put(hsqldb_files_readonly,
++                   getMeta(hsqldb_files_readonly, FILE_PROPERTY, false));
++--- 242,248 ----
++          meta.put(textdb_encoding,
++                   getMeta(textdb_encoding, SET_PROPERTY, null));
++  
++!         // boolean defaults for public props
++          meta.put(db_readonly, getMeta(db_readonly, FILE_PROPERTY, false));
++          meta.put(hsqldb_files_readonly,
++                   getMeta(hsqldb_files_readonly, FILE_PROPERTY, false));
++***************
++*** 304,310 ****
++                   getMeta(textdb_cache_size_scale, SET_PROPERTY, 10, 6, 20));
++      }
++  
++!     private Database database;
++  
++      public HsqlDatabaseProperties(Database db) {
++  
++--- 304,310 ----
++                   getMeta(textdb_cache_size_scale, SET_PROPERTY, 10, 6, 20));
++      }
++  
++!     public Database database;
++  
++      public HsqlDatabaseProperties(Database db) {
++  
++***************
++*** 644,650 ****
++          return FILES_NOT_MODIFIED;
++      }
++  
++!     private static Object[] getMeta(String name, int accessLevel,
++                                      String defaultValue) {
++  
++          Object[] row = new Object[indexLimit];
++--- 644,650 ----
++          return FILES_NOT_MODIFIED;
++      }
++  
++!     public static Object[] getMeta(String name, int accessLevel,
++                                      String defaultValue) {
++  
++          Object[] row = new Object[indexLimit];
++***************
++*** 657,663 ****
++          return row;
++      }
++  
++!     private static Object[] getMeta(String name, int accessLevel,
++                                      boolean defaultValue) {
++  
++          Object[] row = new Object[indexLimit];
++--- 657,663 ----
++          return row;
++      }
++  
++!     public static Object[] getMeta(String name, int accessLevel,
++                                      boolean defaultValue) {
++  
++          Object[] row = new Object[indexLimit];
++***************
++*** 671,677 ****
++          return row;
++      }
++  
++!     private static Object[] getMeta(String name, int accessLevel,
++                                      int defaultValue, byte[] values) {
++  
++          Object[] row = new Object[indexLimit];
++--- 671,677 ----
++          return row;
++      }
++  
++!     public static Object[] getMeta(String name, int accessLevel,
++                                      int defaultValue, byte[] values) {
++  
++          Object[] row = new Object[indexLimit];
++***************
++*** 685,691 ****
++          return row;
++      }
++  
++!     private static Object[] getMeta(String name, int accessLevel,
++                                      int defaultValue, int rangeLow,
++                                      int rangeHigh) {
++  
++--- 685,691 ----
++          return row;
++      }
++  
++!     public static Object[] getMeta(String name, int accessLevel,
++                                      int defaultValue, int rangeLow,
++                                      int rangeHigh) {
++  
++diff -crN hsqldb-old/src/org/hsqldb/persist/HsqlProperties.java hsqldb/src/org/hsqldb/persist/HsqlProperties.java
++*** hsqldb-old/src/org/hsqldb/persist/HsqlProperties.java	2007-10-19 22:16:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/HsqlProperties.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 55,66 ****
++  public class HsqlProperties {
++  
++      public static final int NO_VALUE_FOR_KEY = 1;
++!     protected String        fileName;
++!     protected Properties    stringProps;
++!     protected int[]         errorCodes = new int[0];
++!     protected String[]      errorKeys  = new String[0];
++!     protected boolean       resource   = false;
++!     protected FileAccess    fa;
++  
++      public HsqlProperties() {
++          stringProps = new Properties();
++--- 55,66 ----
++  public class HsqlProperties {
++  
++      public static final int NO_VALUE_FOR_KEY = 1;
++!     public String        fileName;
++!     public Properties    stringProps;
++!     public int[]         errorCodes = new int[0];
++!     public String[]      errorKeys  = new String[0];
++!     public boolean       resource   = false;
++!     public FileAccess    fa;
++  
++      public HsqlProperties() {
++          stringProps = new Properties();
++***************
++*** 295,301 ****
++       * is populated during construction or addition of elements and is used
++       * outside this class to act upon the errors.
++       */
++!     private void addError(int code, String key) {
++  
++          errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
++                  errorCodes.length + 1);
++--- 295,301 ----
++       * is populated during construction or addition of elements and is used
++       * outside this class to act upon the errors.
++       */
++!     public void addError(int code, String key) {
++  
++          errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
++                  errorCodes.length + 1);
++diff -crN hsqldb-old/src/org/hsqldb/persist/LockFile.java hsqldb/src/org/hsqldb/persist/LockFile.java
++*** hsqldb-old/src/org/hsqldb/persist/LockFile.java	2007-10-11 11:32:18.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/LockFile.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 101,107 ****
++   *    </ul>
++   * </ol> <p>
++   *
++!  * In addition to the generic lock and release rules, the protected methods
++   * {@link #lockImpl() lockImpl()} and {@link #releaseImpl() releaseImpl()}
++   * are called during lock and release attempts, respectively.  This allows
++   * transparent, JDK 1.1 compliant integration of extended strategies for
++--- 101,107 ----
++   *    </ul>
++   * </ol> <p>
++   *
++!  * In addition to the generic lock and release rules, the public methods
++   * {@link #lockImpl() lockImpl()} and {@link #releaseImpl() releaseImpl()}
++   * are called during lock and release attempts, respectively.  This allows
++   * transparent, JDK 1.1 compliant integration of extended strategies for
++***************
++*** 156,165 ****
++  public class LockFile {
++  
++      /** Canonical reference to this object's lock file. */
++!     protected File f;
++  
++      /** Cached value of the lock file's canonical path. */
++!     private String cpath = null;
++  
++      /**
++       * A RandomAccessFile constructed from this object's reference, f, to its
++--- 156,165 ----
++  public class LockFile {
++  
++      /** Canonical reference to this object's lock file. */
++!     public File f;
++  
++      /** Cached value of the lock file's canonical path. */
++!     public String cpath = null;
++  
++      /**
++       * A RandomAccessFile constructed from this object's reference, f, to its
++***************
++*** 168,174 ****
++       * This RandomAccessFile is used to periodically write out the heartbeat
++       * timestamp to this object's lock file.
++       */
++!     protected RandomAccessFile raf;
++  
++      /**
++       * The period, in milliseconds, at which heartbeat timestamps are written
++--- 168,174 ----
++       * This RandomAccessFile is used to periodically write out the heartbeat
++       * timestamp to this object's lock file.
++       */
++!     public RandomAccessFile raf;
++  
++      /**
++       * The period, in milliseconds, at which heartbeat timestamps are written
++***************
++*** 183,200 ****
++      public static final byte[] MAGIC = "HSQLLOCK".getBytes();
++  
++      /** Indicates whether this object has a lock condition on its lock file. */
++!     protected boolean locked;
++  
++      /**
++       * The timed scheduler with which to register this object's
++       * heartbeat task.
++       */
++!     protected static final HsqlTimer timer = DatabaseManager.getTimer();
++  
++      /**
++       * An opaque reference to this object's heatbeat task.
++       */
++!     private Object timerTask;
++  
++      /**
++       * Attempts to read the hearbeat timestamp from this object's lock file
++--- 183,200 ----
++      public static final byte[] MAGIC = "HSQLLOCK".getBytes();
++  
++      /** Indicates whether this object has a lock condition on its lock file. */
++!     public boolean locked;
++  
++      /**
++       * The timed scheduler with which to register this object's
++       * heartbeat task.
++       */
++!     public static final HsqlTimer timer = DatabaseManager.getTimer();
++  
++      /**
++       * An opaque reference to this object's heatbeat task.
++       */
++!     public Object timerTask;
++  
++      /**
++       * Attempts to read the hearbeat timestamp from this object's lock file
++***************
++*** 219,225 ****
++       *        or isolated class loader context currently has a
++       *        lock condition on this object's lock file
++       */
++!     private void checkHeartbeat() throws Exception {
++  
++          long   lastHeartbeat;
++          String mn;
++--- 219,225 ----
++       *        or isolated class loader context currently has a
++       *        lock condition on this object's lock file
++       */
++!     public void checkHeartbeat() throws Exception {
++  
++          long   lastHeartbeat;
++          String mn;
++***************
++*** 270,276 ****
++       *
++       * @throws Exception if an IOException occurs
++       */
++!     private void closeRAF() throws Exception {
++  
++          String mn;
++  
++--- 270,276 ----
++       *
++       * @throws Exception if an IOException occurs
++       */
++!     public void closeRAF() throws Exception {
++  
++          String mn;
++  
++***************
++*** 300,306 ****
++       * @param file a reference to the file this object is to use as its
++       *      lock file
++       */
++!     private void setFile(File file) throws Exception {
++  
++          if (isLocked()) {
++              try {
++--- 300,306 ----
++       * @param file a reference to the file this object is to use as its
++       *      lock file
++       */
++!     public void setFile(File file) throws Exception {
++  
++          if (isLocked()) {
++              try {
++***************
++*** 355,361 ****
++       *        actions are taken or the actions succeed,
++       *        else <code>false</code>.
++       */
++!     protected boolean lockImpl() throws Exception {
++  
++          String mn;
++  
++--- 355,361 ----
++       *        actions are taken or the actions succeed,
++       *        else <code>false</code>.
++       */
++!     public boolean lockImpl() throws Exception {
++  
++          String mn;
++  
++***************
++*** 372,378 ****
++       *
++       * @throws Exception if an IOException occurs
++       */
++!     private void openRAF() throws Exception {
++  
++          trace("openRAF(): entered.");
++  
++--- 372,378 ----
++       *
++       * @throws Exception if an IOException occurs
++       */
++!     public void openRAF() throws Exception {
++  
++          trace("openRAF(): entered.");
++  
++***************
++*** 394,400 ****
++       *      file does not exist, Long.MIN_VALUE, the earliest time
++       *      representable as a long in Java,
++       */
++!     private long readHeartbeat() throws Exception {
++  
++          DataInputStream dis;
++          long            heartbeat;
++--- 394,400 ----
++       *      file does not exist, Long.MIN_VALUE, the earliest time
++       *      representable as a long in Java,
++       */
++!     public long readHeartbeat() throws Exception {
++  
++          DataInputStream dis;
++          long            heartbeat;
++***************
++*** 447,453 ****
++       *        to be determined. (e.g. an IO exception
++       *        occurs here).
++       */
++!     protected boolean releaseImpl() throws Exception {
++  
++          trace("releaseImpl(): no action: returning true");
++  
++--- 447,453 ----
++       *        to be determined. (e.g. an IO exception
++       *        occurs here).
++       */
++!     public boolean releaseImpl() throws Exception {
++  
++          trace("releaseImpl(): no action: returning true");
++  
++***************
++*** 455,461 ****
++      }
++  
++      /** Schedules the lock heartbeat task. */
++!     private void startHeartbeat() {
++  
++          Runnable r;
++  
++--- 455,461 ----
++      }
++  
++      /** Schedules the lock heartbeat task. */
++!     public void startHeartbeat() {
++  
++          Runnable r;
++  
++***************
++*** 475,481 ****
++      }
++  
++      /** Cancels the lock heartbeat task. */
++!     private void stopHeartbeat() {
++  
++          String mn = "stopHeartbeat(): ";
++  
++--- 475,481 ----
++      }
++  
++      /** Cancels the lock heartbeat task. */
++!     public void stopHeartbeat() {
++  
++          String mn = "stopHeartbeat(): ";
++  
++***************
++*** 497,503 ****
++       * @throws Exception if the magic value cannot be written to
++       *      the lock file
++       */
++!     private void writeMagic() throws Exception {
++  
++          String mn   = "writeMagic(): ";
++          String path = "lock file [" + cpath + "]";
++--- 497,503 ----
++       * @throws Exception if the magic value cannot be written to
++       *      the lock file
++       */
++!     public void writeMagic() throws Exception {
++  
++          String mn   = "writeMagic(): ";
++          String path = "lock file [" + cpath + "]";
++***************
++*** 517,523 ****
++       * @throws Exception if the current heartbeat timestamp value
++       *      cannot be written
++       */
++!     private void writeHeartbeat() throws Exception {
++  
++          long   time;
++          String mn   = "writeHeartbeat(): ";
++--- 517,523 ----
++       * @throws Exception if the current heartbeat timestamp value
++       *      cannot be written
++       */
++!     public void writeHeartbeat() throws Exception {
++  
++          long   time;
++          String mn   = "writeHeartbeat(): ";
++***************
++*** 752,758 ****
++       * This Runnable class provides the implementation for the timed task
++       * that periodically writes out a heartbeat timestamp to the lock file.<p>
++       */
++!     protected class HeartbeatRunner implements Runnable {
++  
++          public void run() {
++  
++--- 752,758 ----
++       * This Runnable class provides the implementation for the timed task
++       * that periodically writes out a heartbeat timestamp to the lock file.<p>
++       */
++!     public class HeartbeatRunner implements Runnable {
++  
++          public void run() {
++  
++***************
++*** 797,803 ****
++       * @return an implementation-specific tail value for the toString() method
++       * @see #toString
++       */
++!     protected String toStringImpl() {
++          return "";
++      }
++  
++--- 797,803 ----
++       * @return an implementation-specific tail value for the toString() method
++       * @see #toString
++       */
++!     public String toStringImpl() {
++          return "";
++      }
++  
++***************
++*** 954,960 ****
++       *
++       * @param o the value to print
++       */
++!     protected void trace(Object o) {
++  
++          if (Trace.TRACE) {
++              Trace.printSystemOut("[" + super.toString() + "]: " + o);
++--- 954,960 ----
++       *
++       * @param o the value to print
++       */
++!     public void trace(Object o) {
++  
++          if (Trace.TRACE) {
++              Trace.printSystemOut("[" + super.toString() + "]: " + o);
++***************
++*** 969,975 ****
++       *        trying to release the lock condition,
++       *        if any, that it has on its lock file.
++       */
++!     protected void finalize() throws Throwable {
++          trace("finalize(): calling tryRelease()");
++          tryRelease();
++      }
++--- 969,975 ----
++       *        trying to release the lock condition,
++       *        if any, that it has on its lock file.
++       */
++!     public void finalize() throws Throwable {
++          trace("finalize(): calling tryRelease()");
++          tryRelease();
++      }
++diff -crN hsqldb-old/src/org/hsqldb/persist/Logger.java hsqldb/src/org/hsqldb/persist/Logger.java
++*** hsqldb-old/src/org/hsqldb/persist/Logger.java	2006-09-22 15:14:04.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/Logger.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 68,83 ****
++      /**
++       *  The Log object this Logger object wraps
++       */
++!     private Log log;
++  
++      /**
++       *  The LockFile object this Logger uses to cooperatively lock
++       *  the database files
++       */
++!     private LockFile lf;
++      boolean          needsCheckpoint;
++!     private boolean  logStatements;
++!     private boolean  syncFile = false;
++  
++      public Logger() {
++          appLog = new SimpleLog(null, SimpleLog.LOG_NONE, false);
++--- 68,83 ----
++      /**
++       *  The Log object this Logger object wraps
++       */
++!     public Log log;
++  
++      /**
++       *  The LockFile object this Logger uses to cooperatively lock
++       *  the database files
++       */
++!     public LockFile lf;
++      boolean          needsCheckpoint;
++!     public boolean  logStatements;
++!     public boolean  syncFile = false;
++  
++      public Logger() {
++          appLog = new SimpleLog(null, SimpleLog.LOG_NONE, false);
++diff -crN hsqldb-old/src/org/hsqldb/persist/Log.java hsqldb/src/org/hsqldb/persist/Log.java
++*** hsqldb-old/src/org/hsqldb/persist/Log.java	2007-10-19 22:16:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/Log.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 126,143 ****
++   */
++  public class Log {
++  
++!     private HsqlDatabaseProperties properties;
++!     private String                 fileName;
++!     private Database               database;
++!     private FileAccess             fa;
++!     private ScriptWriterBase       dbLogWriter;
++!     private String                 scriptFileName;
++!     private String                 logFileName;
++!     private boolean                filesReadOnly;
++!     private long                   maxLogSize;
++!     private int                    writeDelay;
++!     private int                    scriptFormat;
++!     private DataFileCache          cache;
++  
++      Log(Database db) throws HsqlException {
++  
++--- 126,143 ----
++   */
++  public class Log {
++  
++!     public HsqlDatabaseProperties properties;
++!     public String                 fileName;
++!     public Database               database;
++!     public FileAccess             fa;
++!     public ScriptWriterBase       dbLogWriter;
++!     public String                 scriptFileName;
++!     public String                 logFileName;
++!     public boolean                filesReadOnly;
++!     public long                   maxLogSize;
++!     public int                    writeDelay;
++!     public int                    scriptFormat;
++!     public DataFileCache          cache;
++  
++      Log(Database db) throws HsqlException {
++  
++***************
++*** 614,620 ****
++       * Wrappers for openning-starting / stoping-closing the log file and
++       * writer.
++       */
++!     private void openLog() throws HsqlException {
++  
++          if (filesReadOnly) {
++              return;
++--- 614,620 ----
++       * Wrappers for openning-starting / stoping-closing the log file and
++       * writer.
++       */
++!     public void openLog() throws HsqlException {
++  
++          if (filesReadOnly) {
++              return;
++***************
++*** 632,638 ****
++          }
++      }
++  
++!     private synchronized void closeLog() throws HsqlException {
++  
++          if (dbLogWriter != null) {
++              dbLogWriter.close();
++--- 632,638 ----
++          }
++      }
++  
++!     public synchronized void closeLog() throws HsqlException {
++  
++          if (dbLogWriter != null) {
++              dbLogWriter.close();
++***************
++*** 642,648 ****
++      /**
++       * Write the .script file as .script.new.
++       */
++!     private void writeScript(boolean full) throws HsqlException {
++  
++          deleteNewScript();
++  
++--- 642,648 ----
++      /**
++       * Write the .script file as .script.new.
++       */
++!     public void writeScript(boolean full) throws HsqlException {
++  
++          deleteNewScript();
++  
++***************
++*** 657,663 ****
++      /**
++       * Performs all the commands in the .script file.
++       */
++!     private void processScript() throws HsqlException {
++  
++          ScriptReaderBase scr = null;
++  
++--- 657,663 ----
++      /**
++       * Performs all the commands in the .script file.
++       */
++!     public void processScript() throws HsqlException {
++  
++          ScriptReaderBase scr = null;
++  
++***************
++*** 700,706 ****
++      /**
++       * Defrag large data files when the sum of .log and .data files is large.
++       */
++!     private void processDataFile() throws HsqlException {
++  
++          if (cache == null || filesReadOnly || database.isStoredFileAccess()
++                  || !fa.isStreamElement(logFileName)) {
++--- 700,706 ----
++      /**
++       * Defrag large data files when the sum of .log and .data files is large.
++       */
++!     public void processDataFile() throws HsqlException {
++  
++          if (cache == null || filesReadOnly || database.isStoredFileAccess()
++                  || !fa.isStreamElement(logFileName)) {
++***************
++*** 719,725 ****
++      /**
++       * Performs all the commands in the .log file.
++       */
++!     private void processLog() throws HsqlException {
++  
++          if (!database.isFilesInJar() && fa.isStreamElement(logFileName)) {
++              ScriptRunner.runScript(database, logFileName,
++--- 719,725 ----
++      /**
++       * Performs all the commands in the .log file.
++       */
++!     public void processLog() throws HsqlException {
++  
++          if (!database.isFilesInJar() && fa.isStreamElement(logFileName)) {
++              ScriptRunner.runScript(database, logFileName,
++***************
++*** 730,736 ****
++      /**
++       * Restores a compressed backup or the .data file.
++       */
++!     private void restoreBackup() throws HsqlException {
++  
++          // in case data file cannot be deleted, reset it
++          DataFileCache.deleteOrResetFreePos(database, fileName + ".data");
++--- 730,736 ----
++      /**
++       * Restores a compressed backup or the .data file.
++       */
++!     public void restoreBackup() throws HsqlException {
++  
++          // in case data file cannot be deleted, reset it
++          DataFileCache.deleteOrResetFreePos(database, fileName + ".data");
++***************
++*** 748,754 ****
++      }
++  
++  // fredt@users 20020221 - patch 513005 by sqlbob@users (RMP) - text tables
++!     private HashMap textCacheList = new HashMap();
++  
++      DataFileCache openTextCache(Table table, String source,
++                                  boolean readOnlyData,
++--- 748,754 ----
++      }
++  
++  // fredt@users 20020221 - patch 513005 by sqlbob@users (RMP) - text tables
++!     public HashMap textCacheList = new HashMap();
++  
++      DataFileCache openTextCache(Table table, String source,
++                                  boolean readOnlyData,
++***************
++*** 796,802 ****
++          }
++      }
++  
++!     private void closeAllTextCaches(boolean compact) throws HsqlException {
++  
++          Iterator it = textCacheList.values().iterator();
++  
++--- 796,802 ----
++          }
++      }
++  
++!     public void closeAllTextCaches(boolean compact) throws HsqlException {
++  
++          Iterator it = textCacheList.values().iterator();
++  
++***************
++*** 809,815 ****
++          }
++      }
++  
++!     private void reopenAllTextCaches() throws HsqlException {
++  
++          Iterator it = textCacheList.values().iterator();
++  
++--- 809,815 ----
++          }
++      }
++  
++!     public void reopenAllTextCaches() throws HsqlException {
++  
++          Iterator it = textCacheList.values().iterator();
++  
++***************
++*** 818,824 ****
++          }
++      }
++  
++!     private boolean isAnyTextCacheModified() {
++  
++          Iterator it = textCacheList.values().iterator();
++  
++--- 818,824 ----
++          }
++      }
++  
++!     public boolean isAnyTextCacheModified() {
++  
++          Iterator it = textCacheList.values().iterator();
++  
++diff -crN hsqldb-old/src/org/hsqldb/persist/NIOLockFile.java hsqldb/src/org/hsqldb/persist/NIOLockFile.java
++*** hsqldb-old/src/org/hsqldb/persist/NIOLockFile.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/NIOLockFile.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 61,73 ****
++       * The <code>fc</code> attribute is used to obtain this object's
++       * {@link #fl FileLock} attribute.
++       */
++!     private FileChannel fc;
++  
++      /**
++       * The <code>FileLock</code> object used to lock this object's
++       * lock file.
++       */
++!     private FileLock fl;
++  
++      /**
++       * Tries to obtain a valid NIO lock upon this object's lock file using
++--- 61,73 ----
++       * The <code>fc</code> attribute is used to obtain this object's
++       * {@link #fl FileLock} attribute.
++       */
++!     public FileChannel fc;
++  
++      /**
++       * The <code>FileLock</code> object used to lock this object's
++       * lock file.
++       */
++!     public FileLock fl;
++  
++      /**
++       * Tries to obtain a valid NIO lock upon this object's lock file using
++***************
++*** 77,83 ****
++       * @throws Exception if an error occurs while attempting to obtain the lock
++       *
++       */
++!     protected boolean lockImpl() throws Exception {
++  
++          boolean isValid;
++  
++--- 77,83 ----
++       * @throws Exception if an error occurs while attempting to obtain the lock
++       *
++       */
++!     public boolean lockImpl() throws Exception {
++  
++          boolean isValid;
++  
++***************
++*** 154,160 ****
++       * @return true if a valid lock is released, else false
++       * @throws Exception if na error occurs while attempting to release the lock
++       */
++!     protected boolean releaseImpl() throws Exception {
++  
++          // PRE: we know that this method is only called
++          // if isLocked() is true.
++--- 154,160 ----
++       * @return true if a valid lock is released, else false
++       * @throws Exception if na error occurs while attempting to release the lock
++       */
++!     public boolean releaseImpl() throws Exception {
++  
++          // PRE: we know that this method is only called
++          // if isLocked() is true.
++***************
++*** 200,206 ****
++       * Retrieves the String value: "fl =" + fl
++       * @return the String value: "fl =" + fl
++       */
++!     protected String toStringImpl() {
++          return "fl =" + fl;
++      }
++  }
++--- 200,206 ----
++       * Retrieves the String value: "fl =" + fl
++       * @return the String value: "fl =" + fl
++       */
++!     public String toStringImpl() {
++          return "fl =" + fl;
++      }
++  }
++diff -crN hsqldb-old/src/org/hsqldb/persist/ScaledRAFileHybrid.java hsqldb/src/org/hsqldb/persist/ScaledRAFileHybrid.java
++*** hsqldb-old/src/org/hsqldb/persist/ScaledRAFileHybrid.java	2006-09-22 15:14:04.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/ScaledRAFileHybrid.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 147,153 ****
++          return null;
++      }
++  
++!     private void checkLength(int length) throws IOException {
++  
++          if (store.canAccess(length)) {
++              return;
++--- 147,153 ----
++          return null;
++      }
++  
++!     public void checkLength(int length) throws IOException {
++  
++          if (store.canAccess(length)) {
++              return;
++***************
++*** 156,162 ****
++          newStore(store.getFilePointer() + length);
++      }
++  
++!     private void checkSeek(long position) throws IOException {
++  
++          if (store.canSeek(position)) {
++              return;
++--- 156,162 ----
++          newStore(store.getFilePointer() + length);
++      }
++  
++!     public void checkSeek(long position) throws IOException {
++  
++          if (store.canSeek(position)) {
++              return;
++diff -crN hsqldb-old/src/org/hsqldb/persist/ScaledRAFileInJar.java hsqldb/src/org/hsqldb/persist/ScaledRAFileInJar.java
++*** hsqldb-old/src/org/hsqldb/persist/ScaledRAFileInJar.java	2006-07-27 22:04:30.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/ScaledRAFileInJar.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 92,98 ****
++          return seekPosition;
++      }
++  
++!     private void readIntoBuffer() throws IOException {
++  
++          long filePos = seekPosition;
++  
++--- 92,98 ----
++          return seekPosition;
++      }
++  
++!     public void readIntoBuffer() throws IOException {
++  
++          long filePos = seekPosition;
++  
++***************
++*** 206,212 ****
++          return false;
++      }
++  
++!     private void resetStream() throws IOException {
++  
++          if (file != null) {
++              file.close();
++--- 206,212 ----
++          return false;
++      }
++  
++!     public void resetStream() throws IOException {
++  
++          if (file != null) {
++              file.close();
++***************
++*** 217,223 ****
++          file = new DataInputStream(fis);
++      }
++  
++!     private void fileSeek(long position) throws IOException {
++  
++          long skipPosition = realPosition;
++  
++--- 217,223 ----
++          file = new DataInputStream(fis);
++      }
++  
++!     public void fileSeek(long position) throws IOException {
++  
++          long skipPosition = realPosition;
++  
++diff -crN hsqldb-old/src/org/hsqldb/persist/ScaledRAFile.java hsqldb/src/org/hsqldb/persist/ScaledRAFile.java
++*** hsqldb-old/src/org/hsqldb/persist/ScaledRAFile.java	2007-10-22 07:53:38.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/ScaledRAFile.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 64,70 ****
++      //
++      final SimpleLog                appLog;
++      final RandomAccessFile         file;
++!     private final boolean          readOnly;
++      final String                   fileName;
++      boolean                        isNio;
++      boolean                        bufferDirty = true;
++--- 64,70 ----
++      //
++      final SimpleLog                appLog;
++      final RandomAccessFile         file;
++!     public final boolean          readOnly;
++      final String                   fileName;
++      boolean                        isNio;
++      boolean                        bufferDirty = true;
++***************
++*** 227,233 ****
++          return seekPosition;
++      }
++  
++!     private void readIntoBuffer() throws IOException {
++  
++          long filePos    = seekPosition;
++          long subOffset  = filePos % buffer.length;
++--- 227,233 ----
++          return seekPosition;
++      }
++  
++!     public void readIntoBuffer() throws IOException {
++  
++          long filePos    = seekPosition;
++          long subOffset  = filePos % buffer.length;
++***************
++*** 509,515 ****
++          return null;
++      }
++  
++!     private void resetPointer() {
++  
++          try {
++              bufferDirty = true;
++--- 509,515 ----
++          return null;
++      }
++  
++!     public void resetPointer() {
++  
++          try {
++              bufferDirty = true;
++diff -crN hsqldb-old/src/org/hsqldb/persist/ScaledRAFileNIO.java hsqldb/src/org/hsqldb/persist/ScaledRAFileNIO.java
++*** hsqldb-old/src/org/hsqldb/persist/ScaledRAFileNIO.java	2006-09-22 15:14:04.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/ScaledRAFileNIO.java	2007-11-04 00:14:10.000000000 +0100
++***************
++*** 54,67 ****
++   */
++  class ScaledRAFileNIO implements ScaledRAInterface {
++  
++!     private final boolean       readOnly;
++!     private final long          bufferLength;
++!     private RandomAccessFile    file;
++!     private MappedByteBuffer    buffer;
++!     private FileChannel         channel;
++!     private boolean             bufferModified;
++!     private SimpleLog           appLog;
++!     private final static String JVM_ERROR = "JVM threw unsupported Exception";
++  
++      ScaledRAFileNIO(Database database, String name, boolean readOnly,
++                      int bufferLength) throws Throwable {
++--- 54,67 ----
++   */
++  class ScaledRAFileNIO implements ScaledRAInterface {
++  
++!     public final boolean       readOnly;
++!     public final long          bufferLength;
++!     public RandomAccessFile    file;
++!     public MappedByteBuffer    buffer;
++!     public FileChannel         channel;
++!     public boolean             bufferModified;
++!     public SimpleLog           appLog;
++!     public final static String JVM_ERROR = "JVM threw unsupported Exception";
++  
++      ScaledRAFileNIO(Database database, String name, boolean readOnly,
++                      int bufferLength) throws Throwable {
++diff -crN hsqldb-old/src/org/hsqldb/persist/TextCache.java hsqldb/src/org/hsqldb/persist/TextCache.java
++*** hsqldb-old/src/org/hsqldb/persist/TextCache.java	2007-10-19 22:16:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/persist/TextCache.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 75,83 ****
++      public boolean             isQuoted;
++      public boolean             isAllQuoted;
++      public boolean             ignoreFirst;
++!     protected String           header;
++!     protected Table            table;
++!     private ObjectCacheHashMap uncommittedCache;
++  
++      //
++      final static char DOUBLE_QUOTE_CHAR = '\"';
++--- 75,83 ----
++      public boolean             isQuoted;
++      public boolean             isAllQuoted;
++      public boolean             ignoreFirst;
++!     public String           header;
++!     public Table            table;
++!     public ObjectCacheHashMap uncommittedCache;
++  
++      //
++      final static char DOUBLE_QUOTE_CHAR = '\"';
++***************
++*** 105,111 ****
++          uncommittedCache = new ObjectCacheHashMap(5);
++      }
++  
++!     protected void initParams(Database database,
++                                String baseFileName) throws HsqlException {
++  
++          fileName      = baseFileName;
++--- 105,111 ----
++          uncommittedCache = new ObjectCacheHashMap(5);
++      }
++  
++!     public void initParams(Database database,
++                                String baseFileName) throws HsqlException {
++  
++          fileName      = baseFileName;
++***************
++*** 186,192 ****
++          cacheFileScale   = 1;
++      }
++  
++!     protected void initBuffers() {
++  
++          if (isQuoted || isAllQuoted) {
++              rowIn = new RowInputTextQuoted(fs, vs, lvs, isAllQuoted);
++--- 186,192 ----
++          cacheFileScale   = 1;
++      }
++  
++!     public void initBuffers() {
++  
++          if (isQuoted || isAllQuoted) {
++              rowIn = new RowInputTextQuoted(fs, vs, lvs, isAllQuoted);
++***************
++*** 198,204 ****
++          }
++      }
++  
++!     private String translateSep(String sep) {
++          return translateSep(sep, false);
++      }
++  
++--- 198,204 ----
++          }
++      }
++  
++!     public String translateSep(String sep) {
++          return translateSep(sep, false);
++      }
++  
++***************
++*** 206,212 ****
++       * Translates the escaped characters in a separator string and returns
++       * the non-escaped string.
++       */
++!     private String translateSep(String sep, boolean isProperty) {
++  
++          if (sep == null) {
++              return (null);
++--- 206,212 ----
++       * Translates the escaped characters in a separator string and returns
++       * the non-escaped string.
++       */
++!     public String translateSep(String sep, boolean isProperty) {
++  
++          if (sep == null) {
++              return (null);
++***************
++*** 402,408 ****
++          release(pos);
++      }
++  
++!     private void clearRowImage(CachedObject row) throws IOException {
++  
++          int length = row.getStorageSize()
++                       - ScriptWriterText.BYTES_LINE_SEP.length;
++--- 402,408 ----
++          release(pos);
++      }
++  
++!     public void clearRowImage(CachedObject row) throws IOException {
++  
++          int length = row.getStorageSize()
++                       - ScriptWriterText.BYTES_LINE_SEP.length;
++***************
++*** 431,437 ****
++          clearRowImage(row);
++      }
++  
++!     protected synchronized RowInputInterface readObject(int pos)
++      throws IOException {
++  
++          ByteArray buffer   = new ByteArray(80);
++--- 431,437 ----
++          clearRowImage(row);
++      }
++  
++!     public synchronized RowInputInterface readObject(int pos)
++      throws IOException {
++  
++          ByteArray buffer   = new ByteArray(80);
++***************
++*** 669,675 ****
++       * uncommitted cache until such time that they are committed or rolled
++       * back- fredt
++       */
++!     protected synchronized void saveRows(CachedObject[] rows, int offset,
++                                           int count) throws IOException {
++  
++          if (count == 0) {
++--- 669,675 ----
++       * uncommitted cache until such time that they are committed or rolled
++       * back- fredt
++       */
++!     public synchronized void saveRows(CachedObject[] rows, int offset,
++                                           int count) throws IOException {
++  
++          if (count == 0) {
++***************
++*** 717,723 ****
++          throw Trace.error(Trace.TEXT_TABLE_HEADER);
++      }
++  
++!     private void writeHeader(String header) throws IOException {
++  
++          byte[] buf       = null;
++          String firstLine = header + NL;
++--- 717,723 ----
++          throw Trace.error(Trace.TEXT_TABLE_HEADER);
++      }
++  
++!     public void writeHeader(String header) throws IOException {
++  
++          byte[] buf       = null;
++          String firstLine = header + NL;
++***************
++*** 733,742 ****
++          fileFreePosition = buf.length;
++      }
++  
++!     private class ByteArray {
++  
++!         private byte[] buffer;
++!         private int    buflen;
++  
++          public ByteArray(int n) {
++              buffer = new byte[n];
++--- 733,742 ----
++          fileFreePosition = buf.length;
++      }
++  
++!     public class ByteArray {
++  
++!         public byte[] buffer;
++!         public int    buflen;
++  
++          public ByteArray(int n) {
++              buffer = new byte[n];
++***************
++*** 780,786 ****
++          return ((RowInputText) rowIn).getLineNumber();
++      }
++  
++!     protected void setFileModified() throws IOException {
++          fileModified = true;
++      }
++  }
++--- 780,786 ----
++          return ((RowInputText) rowIn).getLineNumber();
++      }
++  
++!     public void setFileModified() throws IOException {
++          fileModified = true;
++      }
++  }
++diff -crN hsqldb-old/src/org/hsqldb/PointerNode.java hsqldb/src/org/hsqldb/PointerNode.java
++*** hsqldb-old/src/org/hsqldb/PointerNode.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/PointerNode.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 87,94 ****
++  class PointerNode extends BaseMemoryNode {
++  
++      int           iData = NO_POS;
++!     private Table tTable;
++!     private Node  nPrimary;    // node of key / primary index for this row
++  
++      PointerNode(CachedRow r, int id) {
++  
++--- 87,94 ----
++  class PointerNode extends BaseMemoryNode {
++  
++      int           iData = NO_POS;
++!     public Table tTable;
++!     public Node  nPrimary;    // node of key / primary index for this row
++  
++      PointerNode(CachedRow r, int id) {
++  
++diff -crN hsqldb-old/src/org/hsqldb/resources/BundleHandler.java hsqldb/src/org/hsqldb/resources/BundleHandler.java
++*** hsqldb-old/src/org/hsqldb/resources/BundleHandler.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/resources/BundleHandler.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 58,85 ****
++  public final class BundleHandler {
++  
++      /** Used to synchronize access */
++!     private static final Object mutex = new Object();
++  
++      /** The Locale used internally to fetch resource bundles. */
++!     private static Locale locale = Locale.getDefault();
++  
++      /** Map:  Integer object handle => <code>ResourceBundle</code> object. */
++!     private static HashMap bundleHandleMap = new HashMap();
++  
++      /** List whose elements are <code>ResourceBundle</code> objects */
++!     private static HsqlArrayList bundleList = new HsqlArrayList();
++  
++      /**
++       * The resource path prefix of the <code>ResourceBundle</code> objects
++       * handled by this class.
++       */
++!     private static final String prefix = "org/hsqldb/resources/";
++  
++      /** JDK 1.1 compliance */
++!     private static final Method newGetBundleMethod = getNewGetBundleMethod();
++  
++      /** Pure utility class: external construction disabled. */
++!     private BundleHandler() {}
++  
++      /**
++       * Getter for property locale. <p>
++--- 58,85 ----
++  public final class BundleHandler {
++  
++      /** Used to synchronize access */
++!     public static final Object mutex = new Object();
++  
++      /** The Locale used internally to fetch resource bundles. */
++!     public static Locale locale = Locale.getDefault();
++  
++      /** Map:  Integer object handle => <code>ResourceBundle</code> object. */
++!     public static HashMap bundleHandleMap = new HashMap();
++  
++      /** List whose elements are <code>ResourceBundle</code> objects */
++!     public static HsqlArrayList bundleList = new HsqlArrayList();
++  
++      /**
++       * The resource path prefix of the <code>ResourceBundle</code> objects
++       * handled by this class.
++       */
++!     public static final String prefix = "org/hsqldb/resources/";
++  
++      /** JDK 1.1 compliance */
++!     public static final Method newGetBundleMethod = getNewGetBundleMethod();
++  
++      /** Pure utility class: external construction disabled. */
++!     public BundleHandler() {}
++  
++      /**
++       * Getter for property locale. <p>
++***************
++*** 197,203 ****
++       * One-shot initialization of JDK 1.2+ ResourceBundle.getBundle() method
++       * having ClassLoader in the signature.
++       */
++!     private static Method getNewGetBundleMethod() {
++  
++          Class   clazz;
++          Class[] args;
++--- 197,203 ----
++       * One-shot initialization of JDK 1.2+ ResourceBundle.getBundle() method
++       * having ClassLoader in the signature.
++       */
++!     public static Method getNewGetBundleMethod() {
++  
++          Class   clazz;
++          Class[] args;
++diff -crN hsqldb-old/src/org/hsqldb/ResultBase.java hsqldb/src/org/hsqldb/ResultBase.java
++*** hsqldb-old/src/org/hsqldb/ResultBase.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/ResultBase.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 41,48 ****
++  public class ResultBase {
++  
++      public Record    rRoot;
++!     protected Record rTail;
++!     protected int    iSize;
++  
++      public ResultBase() {}
++  
++--- 41,48 ----
++  public class ResultBase {
++  
++      public Record    rRoot;
++!     public Record rTail;
++!     public int    iSize;
++  
++      public ResultBase() {}
++  
++diff -crN hsqldb-old/src/org/hsqldb/Result.java hsqldb/src/org/hsqldb/Result.java
++*** hsqldb-old/src/org/hsqldb/Result.java	2006-09-24 17:37:58.000000000 +0200
++--- hsqldb/src/org/hsqldb/Result.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 102,112 ****
++  
++      // record list
++      public Record  rRoot;
++!     private Record rTail;
++!     private int    size;
++  
++      // transient - number of significant columns
++!     private int significantColumns;
++  
++      // type of result
++      public int mode;
++--- 102,112 ----
++  
++      // record list
++      public Record  rRoot;
++!     public Record rTail;
++!     public int    size;
++  
++      // transient - number of significant columns
++!     public int significantColumns;
++  
++      // type of result
++      public int mode;
++***************
++*** 126,132 ****
++      String subSubString;
++  
++      // the exception if this is an error
++!     private Throwable exception;
++  
++      // prepared statement id / error vendor code
++      int statementID;
++--- 126,132 ----
++      String subSubString;
++  
++      // the exception if this is an error
++!     public Throwable exception;
++  
++      // prepared statement id / error vendor code
++      int statementID;
++***************
++*** 174,180 ****
++           *
++           * @param  columns
++           */
++!         private void prepareData(int columns) {
++  
++              colLabels     = new String[columns];
++              tableNames    = new String[columns];
++--- 174,180 ----
++           *
++           * @param  columns
++           */
++!         public void prepareData(int columns) {
++  
++              colLabels     = new String[columns];
++              tableNames    = new String[columns];
++***************
++*** 200,213 ****
++                     && colNames[i] != null && colNames[i].length() > 0;
++          }
++  
++!         private void decodeTableColumnAttrs(int in, int i) {
++  
++              colNullable[i] = in & 0x0000000f;
++              isIdentity[i]  = (in & 0x00000010) != 0;
++              isWritable[i]  = (in & 0x00000020) != 0;
++          }
++  
++!         private void writeTableColumnAttrs(RowOutputBinary out,
++                                             int i)
++                                             throws IOException, HsqlException {
++  
++--- 200,213 ----
++                     && colNames[i] != null && colNames[i].length() > 0;
++          }
++  
++!         public void decodeTableColumnAttrs(int in, int i) {
++  
++              colNullable[i] = in & 0x0000000f;
++              isIdentity[i]  = (in & 0x00000010) != 0;
++              isWritable[i]  = (in & 0x00000020) != 0;
++          }
++  
++!         public void writeTableColumnAttrs(RowOutputBinary out,
++                                             int i)
++                                             throws IOException, HsqlException {
++  
++***************
++*** 255,261 ****
++                                                     : schemaNames[i]);
++          }
++  
++!         private int encodeTableColumnAttrs(int i) {
++  
++              int out = colNullable[i];    // always between 0x00 and 0x02
++  
++--- 255,261 ----
++                                                     : schemaNames[i]);
++          }
++  
++!         public int encodeTableColumnAttrs(int i) {
++  
++              int out = colNullable[i];    // always between 0x00 and 0x02
++  
++***************
++*** 270,276 ****
++              return out;
++          }
++  
++!         private void readTableColumnAttrs(RowInputBinary in,
++                                            int i)
++                                            throws IOException, HsqlException {
++  
++--- 270,276 ----
++              return out;
++          }
++  
++!         public void readTableColumnAttrs(RowInputBinary in,
++                                            int i)
++                                            throws IOException, HsqlException {
++  
++***************
++*** 1082,1088 ****
++       * @return -1, 0, +1
++       * @throws  HsqlException
++       */
++!     private int compareRecord(Session session, Object[] a, final Object[] b,
++                                final int[] order,
++                                int[] way) throws HsqlException {
++  
++--- 1082,1088 ----
++       * @return -1, 0, +1
++       * @throws  HsqlException
++       */
++!     public int compareRecord(Session session, Object[] a, final Object[] b,
++                                final int[] order,
++                                int[] way) throws HsqlException {
++  
++***************
++*** 1112,1118 ****
++       * @return -1, 0, +1
++       * @throws  HsqlException
++       */
++!     private int compareRecord(Session session, Object[] a, Object[] b,
++                                int len) throws HsqlException {
++  
++          for (int j = 0; j < len; j++) {
++--- 1112,1118 ----
++       * @return -1, 0, +1
++       * @throws  HsqlException
++       */
++!     public int compareRecord(Session session, Object[] a, Object[] b,
++                                int len) throws HsqlException {
++  
++          for (int j = 0; j < len; j++) {
++***************
++*** 1306,1312 ****
++          }
++      }
++  
++!     private void writeMulti(RowOutputBinary out)
++      throws IOException, HsqlException {
++  
++          int startPos = out.size();
++--- 1306,1312 ----
++          }
++      }
++  
++!     public void writeMulti(RowOutputBinary out)
++      throws IOException, HsqlException {
++  
++          int startPos = out.size();
++***************
++*** 1502,1508 ****
++          return new ResultIterator();
++      }
++  
++!     private class ResultIterator implements Iterator {
++  
++          boolean removed;
++          int     counter;
++--- 1502,1508 ----
++          return new ResultIterator();
++      }
++  
++!     public class ResultIterator implements Iterator {
++  
++          boolean removed;
++          int     counter;
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowInputBase.java hsqldb/src/org/hsqldb/rowio/RowInputBase.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowInputBase.java	2006-01-08 21:14:14.000000000 +0100
++--- hsqldb/src/org/hsqldb/rowio/RowInputBase.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 58,65 ****
++      static final int NO_POS = -1;
++  
++      // fredt - initialisation may be unnecessary as it's done in resetRow()
++!     protected int filePos = NO_POS;
++!     protected int size;
++  
++      public RowInputBase() {
++          this(new byte[4]);
++--- 58,65 ----
++      static final int NO_POS = -1;
++  
++      // fredt - initialisation may be unnecessary as it's done in resetRow()
++!     public int filePos = NO_POS;
++!     public int size;
++  
++      public RowInputBase() {
++          this(new byte[4]);
++***************
++*** 99,135 ****
++      public abstract String readString() throws IOException;
++  
++  // fredt@users - comment - methods used for SQL types
++!     protected abstract boolean checkNull() throws IOException;
++  
++!     protected abstract String readChar(int type)
++      throws IOException, HsqlException;
++  
++!     protected abstract Integer readSmallint()
++      throws IOException, HsqlException;
++  
++!     protected abstract Integer readInteger()
++      throws IOException, HsqlException;
++  
++!     protected abstract Long readBigint() throws IOException, HsqlException;
++  
++!     protected abstract Double readReal(int type)
++      throws IOException, HsqlException;
++  
++!     protected abstract BigDecimal readDecimal()
++      throws IOException, HsqlException;
++  
++!     protected abstract Boolean readBit() throws IOException, HsqlException;
++  
++!     protected abstract Time readTime() throws IOException, HsqlException;
++  
++!     protected abstract Date readDate() throws IOException, HsqlException;
++  
++!     protected abstract Timestamp readTimestamp()
++      throws IOException, HsqlException;
++  
++!     protected abstract Object readOther() throws IOException, HsqlException;
++  
++!     protected abstract Binary readBinary(int type)
++      throws IOException, HsqlException;
++  
++      /**
++--- 99,135 ----
++      public abstract String readString() throws IOException;
++  
++  // fredt@users - comment - methods used for SQL types
++!     public abstract boolean checkNull() throws IOException;
++  
++!     public abstract String readChar(int type)
++      throws IOException, HsqlException;
++  
++!     public abstract Integer readSmallint()
++      throws IOException, HsqlException;
++  
++!     public abstract Integer readInteger()
++      throws IOException, HsqlException;
++  
++!     public abstract Long readBigint() throws IOException, HsqlException;
++  
++!     public abstract Double readReal(int type)
++      throws IOException, HsqlException;
++  
++!     public abstract BigDecimal readDecimal()
++      throws IOException, HsqlException;
++  
++!     public abstract Boolean readBit() throws IOException, HsqlException;
++  
++!     public abstract Time readTime() throws IOException, HsqlException;
++  
++!     public abstract Date readDate() throws IOException, HsqlException;
++  
++!     public abstract Timestamp readTimestamp()
++      throws IOException, HsqlException;
++  
++!     public abstract Object readOther() throws IOException, HsqlException;
++  
++!     public abstract Binary readBinary(int type)
++      throws IOException, HsqlException;
++  
++      /**
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowInputBinary.java hsqldb/src/org/hsqldb/rowio/RowInputBinary.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowInputBinary.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowInputBinary.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 58,64 ****
++  public class RowInputBinary extends RowInputBase
++  implements org.hsqldb.rowio.RowInputInterface {
++  
++!     private RowOutputBinary out;
++  
++      public RowInputBinary() {
++          super();
++--- 58,64 ----
++  public class RowInputBinary extends RowInputBase
++  implements org.hsqldb.rowio.RowInputInterface {
++  
++!     public RowOutputBinary out;
++  
++      public RowInputBinary() {
++          super();
++***************
++*** 79,85 ****
++          this.out = out;
++      }
++  
++!     protected byte[] readByteArray() throws IOException {
++  
++          byte[] b = new byte[readInt()];
++  
++--- 79,85 ----
++          this.out = out;
++      }
++  
++!     public byte[] readByteArray() throws IOException {
++  
++          byte[] b = new byte[readInt()];
++  
++***************
++*** 115,121 ****
++          return s;
++      }
++  
++!     protected boolean checkNull() throws IOException {
++  
++          int b = readByte();
++  
++--- 115,121 ----
++          return s;
++      }
++  
++!     public boolean checkNull() throws IOException {
++  
++          int b = readByte();
++  
++***************
++*** 123,149 ****
++                        : false;
++      }
++  
++!     protected String readChar(int type) throws IOException {
++          return readString();
++      }
++  
++!     protected Integer readSmallint() throws IOException, HsqlException {
++          return ValuePool.getInt(readShort());
++      }
++  
++!     protected Integer readInteger() throws IOException, HsqlException {
++          return ValuePool.getInt(readInt());
++      }
++  
++!     protected Long readBigint() throws IOException, HsqlException {
++          return ValuePool.getLong(readLong());
++      }
++  
++!     protected Double readReal(int type) throws IOException, HsqlException {
++          return ValuePool.getDouble(readLong());
++      }
++  
++!     protected BigDecimal readDecimal() throws IOException, HsqlException {
++  
++          byte[]     bytes  = readByteArray();
++          int        scale  = readInt();
++--- 123,149 ----
++                        : false;
++      }
++  
++!     public String readChar(int type) throws IOException {
++          return readString();
++      }
++  
++!     public Integer readSmallint() throws IOException, HsqlException {
++          return ValuePool.getInt(readShort());
++      }
++  
++!     public Integer readInteger() throws IOException, HsqlException {
++          return ValuePool.getInt(readInt());
++      }
++  
++!     public Long readBigint() throws IOException, HsqlException {
++          return ValuePool.getLong(readLong());
++      }
++  
++!     public Double readReal(int type) throws IOException, HsqlException {
++          return ValuePool.getDouble(readLong());
++      }
++  
++!     public BigDecimal readDecimal() throws IOException, HsqlException {
++  
++          byte[]     bytes  = readByteArray();
++          int        scale  = readInt();
++***************
++*** 152,182 ****
++          return ValuePool.getBigDecimal(new BigDecimal(bigint, scale));
++      }
++  
++!     protected Boolean readBit() throws IOException, HsqlException {
++          return readBoolean() ? Boolean.TRUE
++                               : Boolean.FALSE;
++      }
++  
++!     protected Time readTime() throws IOException, HsqlException {
++          return new Time(HsqlDateTime.getNormalisedTime(readLong()));
++      }
++  
++!     protected Date readDate() throws IOException, HsqlException {
++  
++          long date = HsqlDateTime.getNormalisedDate(readLong());
++  
++          return ValuePool.getDate(date);
++      }
++  
++!     protected Timestamp readTimestamp() throws IOException, HsqlException {
++          return HsqlDateTime.timestampValue(readLong(), readInt());
++      }
++  
++!     protected Object readOther() throws IOException, HsqlException {
++          return new JavaObject(readByteArray());
++      }
++  
++!     protected Binary readBinary(int type) throws IOException, HsqlException {
++          return new Binary(readByteArray(), false);
++      }
++  
++--- 152,182 ----
++          return ValuePool.getBigDecimal(new BigDecimal(bigint, scale));
++      }
++  
++!     public Boolean readBit() throws IOException, HsqlException {
++          return readBoolean() ? Boolean.TRUE
++                               : Boolean.FALSE;
++      }
++  
++!     public Time readTime() throws IOException, HsqlException {
++          return new Time(HsqlDateTime.getNormalisedTime(readLong()));
++      }
++  
++!     public Date readDate() throws IOException, HsqlException {
++  
++          long date = HsqlDateTime.getNormalisedDate(readLong());
++  
++          return ValuePool.getDate(date);
++      }
++  
++!     public Timestamp readTimestamp() throws IOException, HsqlException {
++          return HsqlDateTime.timestampValue(readLong(), readInt());
++      }
++  
++!     public Object readOther() throws IOException, HsqlException {
++          return new JavaObject(readByteArray());
++      }
++  
++!     public Binary readBinary(int type) throws IOException, HsqlException {
++          return new Binary(readByteArray(), false);
++      }
++  
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowInputText.java hsqldb/src/org/hsqldb/rowio/RowInputText.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowInputText.java	2007-06-11 12:12:30.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowInputText.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 55,75 ****
++  public class RowInputText extends RowInputBase implements RowInputInterface {
++  
++      // text table specific
++!     private String    fieldSep;
++!     private String    varSep;
++!     private String    longvarSep;
++!     private int       fieldSepLen;
++!     private int       varSepLen;
++!     private int       longvarSepLen;
++!     private boolean   fieldSepEnd;
++!     private boolean   varSepEnd;
++!     private boolean   longvarSepEnd;
++!     private int       textLen;
++!     protected String  text;
++!     protected int     line;
++!     protected int     field;
++!     protected int     next = 0;
++!     protected boolean allQuoted;
++  
++      /**
++       * fredt@users - comment - in future may use a custom subclasse of
++--- 55,75 ----
++  public class RowInputText extends RowInputBase implements RowInputInterface {
++  
++      // text table specific
++!     public String    fieldSep;
++!     public String    varSep;
++!     public String    longvarSep;
++!     public int       fieldSepLen;
++!     public int       varSepLen;
++!     public int       longvarSepLen;
++!     public boolean   fieldSepEnd;
++!     public boolean   varSepEnd;
++!     public boolean   longvarSepEnd;
++!     public int       textLen;
++!     public String  text;
++!     public int     line;
++!     public int     field;
++!     public int     next = 0;
++!     public boolean allQuoted;
++  
++      /**
++       * fredt@users - comment - in future may use a custom subclasse of
++***************
++*** 120,126 ****
++          field = 0;
++      }
++  
++!     protected String getField(String sep, int sepLen,
++                                boolean isEnd) throws IOException {
++  
++          String s = null;
++--- 120,126 ----
++          field = 0;
++      }
++  
++!     public String getField(String sep, int sepLen,
++                                boolean isEnd) throws IOException {
++  
++          String s = null;
++***************
++*** 172,182 ****
++          return getField(fieldSep, fieldSepLen, fieldSepEnd);
++      }
++  
++!     private String readVarString() throws IOException {
++          return getField(varSep, varSepLen, varSepEnd);
++      }
++  
++!     private String readLongVarString() throws IOException {
++          return getField(longvarSep, longvarSepLen, longvarSepEnd);
++      }
++  
++--- 172,182 ----
++          return getField(fieldSep, fieldSepLen, fieldSepEnd);
++      }
++  
++!     public String readVarString() throws IOException {
++          return getField(varSep, varSepLen, varSepEnd);
++      }
++  
++!     public String readLongVarString() throws IOException {
++          return getField(longvarSep, longvarSepLen, longvarSepEnd);
++      }
++  
++***************
++*** 210,222 ****
++          return 0;
++      }
++  
++!     protected boolean checkNull() {
++  
++          // Return null on each column read instead.
++          return false;
++      }
++  
++!     protected String readChar(int type) throws IOException {
++  
++          switch (type) {
++  
++--- 210,222 ----
++          return 0;
++      }
++  
++!     public boolean checkNull() {
++  
++          // Return null on each column read instead.
++          return false;
++      }
++  
++!     public String readChar(int type) throws IOException {
++  
++          switch (type) {
++  
++***************
++*** 233,239 ****
++          }
++      }
++  
++!     protected Integer readSmallint() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 233,239 ----
++          }
++      }
++  
++!     public Integer readSmallint() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 250,256 ****
++          return Integer.valueOf(s);
++      }
++  
++!     protected Integer readInteger() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 250,256 ----
++          return Integer.valueOf(s);
++      }
++  
++!     public Integer readInteger() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 267,273 ****
++          return Integer.valueOf(s);
++      }
++  
++!     protected Long readBigint() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 267,273 ----
++          return Integer.valueOf(s);
++      }
++  
++!     public Long readBigint() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 284,290 ****
++          return Long.valueOf(s);
++      }
++  
++!     protected Double readReal(int type) throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 284,290 ----
++          return Long.valueOf(s);
++      }
++  
++!     public Double readReal(int type) throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 301,307 ****
++          return Double.valueOf(s);
++      }
++  
++!     protected BigDecimal readDecimal() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 301,307 ----
++          return Double.valueOf(s);
++      }
++  
++!     public BigDecimal readDecimal() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 318,324 ****
++          return new BigDecimal(s);
++      }
++  
++!     protected Time readTime() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 318,324 ----
++          return new BigDecimal(s);
++      }
++  
++!     public Time readTime() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 335,341 ****
++          return HsqlDateTime.timeValue(s);
++      }
++  
++!     protected Date readDate() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 335,341 ----
++          return HsqlDateTime.timeValue(s);
++      }
++  
++!     public Date readDate() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 352,358 ****
++          return HsqlDateTime.dateValue(s);
++      }
++  
++!     protected Timestamp readTimestamp() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 352,358 ----
++          return HsqlDateTime.dateValue(s);
++      }
++  
++!     public Timestamp readTimestamp() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 369,375 ****
++          return HsqlDateTime.timestampValue(s);
++      }
++  
++!     protected Boolean readBit() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 369,375 ----
++          return HsqlDateTime.timestampValue(s);
++      }
++  
++!     public Boolean readBit() throws IOException, HsqlException {
++  
++          String s = readString();
++  
++***************
++*** 387,393 ****
++                                            : Boolean.FALSE;
++      }
++  
++!     protected Object readOther() throws IOException, HsqlException {
++  
++          byte[] data;
++          String s = readString();
++--- 387,393 ----
++                                            : Boolean.FALSE;
++      }
++  
++!     public Object readOther() throws IOException, HsqlException {
++  
++          byte[] data;
++          String s = readString();
++***************
++*** 407,413 ****
++          return new JavaObject(data);
++      }
++  
++!     protected Binary readBinary(int type) throws IOException, HsqlException {
++  
++          String s = readString();
++  
++--- 407,413 ----
++          return new JavaObject(data);
++      }
++  
++!     public Binary readBinary(int type) throws IOException, HsqlException {
++  
++          String s = readString();
++  
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowInputTextLog.java hsqldb/src/org/hsqldb/rowio/RowInputTextLog.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowInputTextLog.java	2007-06-21 15:27:52.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowInputTextLog.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 115,121 ****
++          return schemaName;
++      }
++  
++!     protected String readField() throws IOException {
++  
++          try {
++              tokenizer.getString();
++--- 115,121 ----
++          return schemaName;
++      }
++  
++!     public String readField() throws IOException {
++  
++          try {
++              tokenizer.getString();
++***************
++*** 137,143 ****
++          }
++      }
++  
++!     protected String readNumberField() throws IOException {
++  
++          try {
++              tokenizer.getString();
++--- 137,143 ----
++          }
++      }
++  
++!     public String readNumberField() throws IOException {
++  
++          try {
++              tokenizer.getString();
++***************
++*** 205,221 ****
++          return 0;
++      }
++  
++!     protected boolean checkNull() {
++  
++          // Return null on each column read instead.
++          return false;
++      }
++  
++!     protected String readChar(int type) throws IOException {
++          return readString();
++      }
++  
++!     protected Integer readSmallint() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++--- 205,221 ----
++          return 0;
++      }
++  
++!     public boolean checkNull() {
++  
++          // Return null on each column read instead.
++          return false;
++      }
++  
++!     public String readChar(int type) throws IOException {
++          return readString();
++      }
++  
++!     public Integer readSmallint() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++***************
++*** 228,234 ****
++          return ValuePool.getInt(i);
++      }
++  
++!     protected Integer readInteger() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++--- 228,234 ----
++          return ValuePool.getInt(i);
++      }
++  
++!     public Integer readInteger() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++***************
++*** 241,247 ****
++          return ValuePool.getInt(i);
++      }
++  
++!     protected Long readBigint() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++--- 241,247 ----
++          return ValuePool.getInt(i);
++      }
++  
++!     public Long readBigint() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++***************
++*** 254,260 ****
++          return ValuePool.getLong(i);
++      }
++  
++!     protected Double readReal(int type) throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++--- 254,260 ----
++          return ValuePool.getLong(i);
++      }
++  
++!     public Double readReal(int type) throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++***************
++*** 282,288 ****
++          return ValuePool.getDouble(Double.doubleToLongBits(i));
++      }
++  
++!     protected BigDecimal readDecimal() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++--- 282,288 ----
++          return ValuePool.getDouble(Double.doubleToLongBits(i));
++      }
++  
++!     public BigDecimal readDecimal() throws IOException, HsqlException {
++  
++          String s = readNumberField();
++  
++***************
++*** 295,301 ****
++          return ValuePool.getBigDecimal(i);
++      }
++  
++!     protected Time readTime() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++--- 295,301 ----
++          return ValuePool.getBigDecimal(i);
++      }
++  
++!     public Time readTime() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++***************
++*** 306,312 ****
++          return HsqlDateTime.timeValue(s);
++      }
++  
++!     protected Date readDate() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++--- 306,312 ----
++          return HsqlDateTime.timeValue(s);
++      }
++  
++!     public Date readDate() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++***************
++*** 317,323 ****
++          return HsqlDateTime.dateValue(s);
++      }
++  
++!     protected Timestamp readTimestamp() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++--- 317,323 ----
++          return HsqlDateTime.dateValue(s);
++      }
++  
++!     public Timestamp readTimestamp() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++***************
++*** 328,334 ****
++          return HsqlDateTime.timestampValue(s);
++      }
++  
++!     protected Boolean readBit() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++--- 328,334 ----
++          return HsqlDateTime.timestampValue(s);
++      }
++  
++!     public Boolean readBit() throws IOException, HsqlException {
++  
++          String s = readField();
++  
++***************
++*** 340,346 ****
++                                            : Boolean.FALSE;
++      }
++  
++!     protected Object readOther() throws IOException, HsqlException {
++  
++          byte[] data;
++          String s = readField();
++--- 340,346 ----
++                                            : Boolean.FALSE;
++      }
++  
++!     public Object readOther() throws IOException, HsqlException {
++  
++          byte[] data;
++          String s = readField();
++***************
++*** 354,360 ****
++          return new JavaObject(data);
++      }
++  
++!     protected Binary readBinary(int type) throws IOException, HsqlException {
++  
++          String s = readField();
++  
++--- 354,360 ----
++          return new JavaObject(data);
++      }
++  
++!     public Binary readBinary(int type) throws IOException, HsqlException {
++  
++          String s = readField();
++  
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowInputTextQuoted.java hsqldb/src/org/hsqldb/rowio/RowInputTextQuoted.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowInputTextQuoted.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowInputTextQuoted.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 46,55 ****
++   */
++  public class RowInputTextQuoted extends RowInputText {
++  
++!     private static final int NORMAL_FIELD   = 0;
++!     private static final int NEED_END_QUOTE = 1;
++!     private static final int FOUND_QUOTE    = 2;
++!     private char[]           qtext;
++  
++      public RowInputTextQuoted(String fieldSep, String varSep,
++                                String longvarSep, boolean allQuoted) {
++--- 46,55 ----
++   */
++  public class RowInputTextQuoted extends RowInputText {
++  
++!     public static final int NORMAL_FIELD   = 0;
++!     public static final int NEED_END_QUOTE = 1;
++!     public static final int FOUND_QUOTE    = 2;
++!     public char[]           qtext;
++  
++      public RowInputTextQuoted(String fieldSep, String varSep,
++                                String longvarSep, boolean allQuoted) {
++***************
++*** 63,69 ****
++          qtext = text.toCharArray();
++      }
++  
++!     protected String getField(String sep, int sepLen,
++                                boolean isEnd) throws IOException {
++  
++          //fredt - now the only supported behaviour is emptyIsNull
++--- 63,69 ----
++          qtext = text.toCharArray();
++      }
++  
++!     public String getField(String sep, int sepLen,
++                                boolean isEnd) throws IOException {
++  
++          //fredt - now the only supported behaviour is emptyIsNull
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowOutputBase.java hsqldb/src/org/hsqldb/rowio/RowOutputBase.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowOutputBase.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowOutputBase.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 62,68 ****
++      public static final int CACHED_ROW_170 = 1;
++  
++      // the last column in a table is an ID that should not be written to file
++!     protected boolean skipSystemId = false;
++  
++      /**
++       *  Constructor used for persistent storage of a Table row
++--- 62,68 ----
++      public static final int CACHED_ROW_170 = 1;
++  
++      // the last column in a table is an ID that should not be written to file
++!     public boolean skipSystemId = false;
++  
++      /**
++       *  Constructor used for persistent storage of a Table row
++***************
++*** 107,141 ****
++      public abstract void writeString(String s);
++  
++  // fredt@users - comment - methods used for writing each SQL type
++!     protected void writeFieldPrefix() {}
++  
++!     protected abstract void writeFieldType(int type);
++  
++!     protected abstract void writeNull(int type);
++  
++!     protected abstract void writeChar(String s, int t);
++  
++!     protected abstract void writeSmallint(Number o);
++  
++!     protected abstract void writeInteger(Number o);
++  
++!     protected abstract void writeBigint(Number o);
++  
++!     protected abstract void writeReal(Double o, int type);
++  
++!     protected abstract void writeDecimal(BigDecimal o);
++  
++!     protected abstract void writeBit(Boolean o);
++  
++!     protected abstract void writeDate(Date o);
++  
++!     protected abstract void writeTime(Time o);
++  
++!     protected abstract void writeTimestamp(Timestamp o);
++  
++!     protected abstract void writeOther(JavaObject o);
++  
++!     protected abstract void writeBinary(Binary o, int t);
++  
++      public void writeRow(Object[] data, Table t) {
++  
++--- 107,141 ----
++      public abstract void writeString(String s);
++  
++  // fredt@users - comment - methods used for writing each SQL type
++!     public void writeFieldPrefix() {}
++  
++!     public abstract void writeFieldType(int type);
++  
++!     public abstract void writeNull(int type);
++  
++!     public abstract void writeChar(String s, int t);
++  
++!     public abstract void writeSmallint(Number o);
++  
++!     public abstract void writeInteger(Number o);
++  
++!     public abstract void writeBigint(Number o);
++  
++!     public abstract void writeReal(Double o, int type);
++  
++!     public abstract void writeDecimal(BigDecimal o);
++  
++!     public abstract void writeBit(Boolean o);
++  
++!     public abstract void writeDate(Date o);
++  
++!     public abstract void writeTime(Time o);
++  
++!     public abstract void writeTimestamp(Timestamp o);
++  
++!     public abstract void writeOther(JavaObject o);
++  
++!     public abstract void writeBinary(Binary o, int t);
++  
++      public void writeRow(Object[] data, Table t) {
++  
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowOutputBinary.java hsqldb/src/org/hsqldb/rowio/RowOutputBinary.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowOutputBinary.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowOutputBinary.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 57,63 ****
++   */
++  public class RowOutputBinary extends RowOutputBase {
++  
++!     private static final int INT_STORE_SIZE = 4;
++      int                      storageSize;
++  
++      public RowOutputBinary() {
++--- 57,63 ----
++   */
++  public class RowOutputBinary extends RowOutputBase {
++  
++!     public static final int INT_STORE_SIZE = 4;
++      int                      storageSize;
++  
++      public RowOutputBinary() {
++***************
++*** 160,194 ****
++      }
++  
++  // fredt@users - comment - methods used for writing each SQL type
++!     protected void writeFieldType(int type) {
++          write(1);
++      }
++  
++!     protected void writeNull(int type) {
++          write(0);
++      }
++  
++!     protected void writeChar(String s, int t) {
++          writeString(s);
++      }
++  
++!     protected void writeSmallint(Number o) {
++          writeShort(o.intValue());
++      }
++  
++!     protected void writeInteger(Number o) {
++          writeInt(o.intValue());
++      }
++  
++!     protected void writeBigint(Number o) {
++          writeLong(o.longValue());
++      }
++  
++!     protected void writeReal(Double o, int type) {
++          writeLong(Double.doubleToLongBits((o.doubleValue())));
++      }
++  
++!     protected void writeDecimal(BigDecimal o) {
++  
++          int        scale   = o.scale();
++          BigInteger bigint  = JavaSystem.getUnscaledValue(o);
++--- 160,194 ----
++      }
++  
++  // fredt@users - comment - methods used for writing each SQL type
++!     public void writeFieldType(int type) {
++          write(1);
++      }
++  
++!     public void writeNull(int type) {
++          write(0);
++      }
++  
++!     public void writeChar(String s, int t) {
++          writeString(s);
++      }
++  
++!     public void writeSmallint(Number o) {
++          writeShort(o.intValue());
++      }
++  
++!     public void writeInteger(Number o) {
++          writeInt(o.intValue());
++      }
++  
++!     public void writeBigint(Number o) {
++          writeLong(o.longValue());
++      }
++  
++!     public void writeReal(Double o, int type) {
++          writeLong(Double.doubleToLongBits((o.doubleValue())));
++      }
++  
++!     public void writeDecimal(BigDecimal o) {
++  
++          int        scale   = o.scale();
++          BigInteger bigint  = JavaSystem.getUnscaledValue(o);
++***************
++*** 198,231 ****
++          writeInt(scale);
++      }
++  
++!     protected void writeBit(Boolean o) {
++          write(o.booleanValue() ? 1
++                                 : 0);
++      }
++  
++!     protected void writeDate(Date o) {
++          writeLong(o.getTime());
++      }
++  
++!     protected void writeTime(Time o) {
++          writeLong(o.getTime());
++      }
++  
++!     protected void writeTimestamp(Timestamp o) {
++          writeLong(o.getTime());
++          writeInt(o.getNanos());
++      }
++  
++!     protected void writeOther(JavaObject o) {
++          writeByteArray(o.getBytes());
++      }
++  
++!     protected void writeBinary(Binary o, int t) {
++          writeByteArray(o.getBytes());
++      }
++  
++  // fredt@users - comment - helper and conversion methods
++!     protected void writeByteArray(byte[] b) {
++          writeInt(b.length);
++          write(b, 0, b.length);
++      }
++--- 198,231 ----
++          writeInt(scale);
++      }
++  
++!     public void writeBit(Boolean o) {
++          write(o.booleanValue() ? 1
++                                 : 0);
++      }
++  
++!     public void writeDate(Date o) {
++          writeLong(o.getTime());
++      }
++  
++!     public void writeTime(Time o) {
++          writeLong(o.getTime());
++      }
++  
++!     public void writeTimestamp(Timestamp o) {
++          writeLong(o.getTime());
++          writeInt(o.getNanos());
++      }
++  
++!     public void writeOther(JavaObject o) {
++          writeByteArray(o.getBytes());
++      }
++  
++!     public void writeBinary(Binary o, int t) {
++          writeByteArray(o.getBytes());
++      }
++  
++  // fredt@users - comment - helper and conversion methods
++!     public void writeByteArray(byte[] b) {
++          writeInt(b.length);
++          write(b, 0, b.length);
++      }
++***************
++*** 239,245 ****
++       * @return size of byte array
++       * @exception  HsqlException when data is inconsistent
++       */
++!     private static int getSize(Object[] data, int l, int[] type) {
++  
++          int s = 0;
++  
++--- 239,245 ----
++       * @return size of byte array
++       * @exception  HsqlException when data is inconsistent
++       */
++!     public static int getSize(Object[] data, int l, int[] type) {
++  
++          int s = 0;
++  
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowOutputText.java hsqldb/src/org/hsqldb/rowio/RowOutputText.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowOutputText.java	2006-01-08 21:14:14.000000000 +0100
++--- hsqldb/src/org/hsqldb/rowio/RowOutputText.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 54,69 ****
++   */
++  public class RowOutputText extends RowOutputBase {
++  
++!     protected String  fieldSep;
++!     protected String  varSep;
++!     protected String  longvarSep;
++!     private boolean   fieldSepEnd;
++!     private boolean   varSepEnd;
++!     private boolean   longvarSepEnd;
++!     private String    nextSep = "";
++!     private boolean   nextSepEnd;
++!     protected boolean allQuoted;
++!     private String    encoding;
++  
++      public RowOutputText(String fieldSep, String varSep, String longvarSep,
++                           boolean allQuoted, String encoding) {
++--- 54,69 ----
++   */
++  public class RowOutputText extends RowOutputBase {
++  
++!     public String  fieldSep;
++!     public String  varSep;
++!     public String  longvarSep;
++!     public boolean   fieldSepEnd;
++!     public boolean   varSepEnd;
++!     public boolean   longvarSepEnd;
++!     public String    nextSep = "";
++!     public boolean   nextSepEnd;
++!     public boolean allQuoted;
++!     public String    encoding;
++  
++      public RowOutputText(String fieldSep, String varSep, String longvarSep,
++                           boolean allQuoted, String encoding) {
++***************
++*** 74,80 ****
++                                    encoding);
++      }
++  
++!     private void initTextDatabaseRowOutput(String fieldSep, String varSep,
++                                             String longvarSep,
++                                             boolean allQuoted,
++                                             String encoding) {
++--- 74,80 ----
++                                    encoding);
++      }
++  
++!     public void initTextDatabaseRowOutput(String fieldSep, String varSep,
++                                             String longvarSep,
++                                             boolean allQuoted,
++                                             String encoding) {
++***************
++*** 142,148 ****
++          nextSepEnd = fieldSepEnd;
++      }
++  
++!     protected void writeVarString(String s) {
++  
++          s = checkConvertString(s, varSep);
++  
++--- 142,148 ----
++          nextSepEnd = fieldSepEnd;
++      }
++  
++!     public void writeVarString(String s) {
++  
++          s = checkConvertString(s, varSep);
++  
++***************
++*** 159,165 ****
++          nextSepEnd = varSepEnd;
++      }
++  
++!     protected void writeLongVarString(String s) {
++  
++          s = checkConvertString(s, longvarSep);
++  
++--- 159,165 ----
++          nextSepEnd = varSepEnd;
++      }
++  
++!     public void writeLongVarString(String s) {
++  
++          s = checkConvertString(s, longvarSep);
++  
++***************
++*** 176,182 ****
++          nextSepEnd = longvarSepEnd;
++      }
++  
++!     protected String checkConvertString(String s, String sep) {
++  
++          if (s.indexOf('\n') != -1 || s.indexOf('\r') != -1) {
++              throw new IllegalArgumentException(
++--- 176,182 ----
++          nextSepEnd = longvarSepEnd;
++      }
++  
++!     public String checkConvertString(String s, String sep) {
++  
++          if (s.indexOf('\n') != -1 || s.indexOf('\r') != -1) {
++              throw new IllegalArgumentException(
++***************
++*** 188,194 ****
++          return s;
++      }
++  
++!     private byte[] getBytes(String s) {
++  
++          byte[] bytes = null;
++  
++--- 188,194 ----
++          return s;
++      }
++  
++!     public byte[] getBytes(String s) {
++  
++          byte[] bytes = null;
++  
++***************
++*** 201,207 ****
++          return bytes;
++      }
++  
++!     protected void writeByteArray(byte[] b) {
++  
++          ensureRoom(b.length * 2);
++          StringConverter.writeHex(this.getBuffer(), count, b);
++--- 201,207 ----
++          return bytes;
++      }
++  
++!     public void writeByteArray(byte[] b) {
++  
++          ensureRoom(b.length * 2);
++          StringConverter.writeHex(this.getBuffer(), count, b);
++***************
++*** 232,238 ****
++      }
++  
++  // fredt@users - comment - methods used for writing each SQL type
++!     protected void writeFieldType(int type) {
++  
++          writeBytes(nextSep);
++  
++--- 232,238 ----
++      }
++  
++  // fredt@users - comment - methods used for writing each SQL type
++!     public void writeFieldType(int type) {
++  
++          writeBytes(nextSep);
++  
++***************
++*** 256,266 ****
++          }
++      }
++  
++!     protected void writeNull(int type) {
++          writeFieldType(type);
++      }
++  
++!     protected void writeChar(String s, int t) {
++  
++          switch (t) {
++  
++--- 256,266 ----
++          }
++      }
++  
++!     public void writeNull(int type) {
++          writeFieldType(type);
++      }
++  
++!     public void writeChar(String s, int t) {
++  
++          switch (t) {
++  
++***************
++*** 283,332 ****
++          }
++      }
++  
++!     protected void writeSmallint(Number o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeInteger(Number o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeBigint(Number o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeReal(Double o, int type) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeDecimal(BigDecimal o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeBit(Boolean o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeDate(Date o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeTime(Time o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeTimestamp(Timestamp o) {
++          writeString(o.toString());
++      }
++  
++!     protected void writeOther(JavaObject o) {
++  
++          byte[] ba = o.getBytes();
++  
++          writeByteArray(ba);
++      }
++  
++!     protected void writeBinary(Binary o, int t) {
++          writeByteArray(o.getBytes());
++      }
++  
++--- 283,332 ----
++          }
++      }
++  
++!     public void writeSmallint(Number o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeInteger(Number o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeBigint(Number o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeReal(Double o, int type) {
++          writeString(o.toString());
++      }
++  
++!     public void writeDecimal(BigDecimal o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeBit(Boolean o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeDate(Date o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeTime(Time o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeTimestamp(Timestamp o) {
++          writeString(o.toString());
++      }
++  
++!     public void writeOther(JavaObject o) {
++  
++          byte[] ba = o.getBytes();
++  
++          writeByteArray(ba);
++      }
++  
++!     public void writeBinary(Binary o, int t) {
++          writeByteArray(o.getBytes());
++      }
++  
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowOutputTextLog.java hsqldb/src/org/hsqldb/rowio/RowOutputTextLog.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowOutputTextLog.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowOutputTextLog.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 57,101 ****
++      static final byte[]     BYTES_IS    = " IS ".getBytes();
++      public static final int MODE_DELETE = 1;
++      public static final int MODE_INSERT = 0;
++!     private boolean         isWritten;
++!     private int             logMode;
++  
++      public void setMode(int mode) {
++          logMode = mode;
++      }
++  
++!     protected void writeFieldPrefix() {
++  
++          if (logMode == MODE_DELETE && isWritten) {
++              write(BYTES_AND);
++          }
++      }
++  
++!     protected void writeChar(String s, int t) {
++  
++          write('\'');
++          StringConverter.unicodeToAscii(this, s, true);
++          write('\'');
++      }
++  
++!     protected void writeReal(Double o, int type) {
++          writeBytes(Column.createSQLString(((Number) o).doubleValue()));
++      }
++  
++!     protected void writeSmallint(Number o) {
++          this.writeBytes(o.toString());
++      }
++  
++      public void writeEnd() {}
++  
++!     protected void writeTime(Time o) {
++  
++          write('\'');
++          writeBytes(o.toString());
++          write('\'');
++      }
++  
++!     protected void writeBinary(Binary o, int t) {
++  
++          ensureRoom(o.getBytesLength() * 2 + 2);
++          write('\'');
++--- 57,101 ----
++      static final byte[]     BYTES_IS    = " IS ".getBytes();
++      public static final int MODE_DELETE = 1;
++      public static final int MODE_INSERT = 0;
++!     public boolean         isWritten;
++!     public int             logMode;
++  
++      public void setMode(int mode) {
++          logMode = mode;
++      }
++  
++!     public void writeFieldPrefix() {
++  
++          if (logMode == MODE_DELETE && isWritten) {
++              write(BYTES_AND);
++          }
++      }
++  
++!     public void writeChar(String s, int t) {
++  
++          write('\'');
++          StringConverter.unicodeToAscii(this, s, true);
++          write('\'');
++      }
++  
++!     public void writeReal(Double o, int type) {
++          writeBytes(Column.createSQLString(((Number) o).doubleValue()));
++      }
++  
++!     public void writeSmallint(Number o) {
++          this.writeBytes(o.toString());
++      }
++  
++      public void writeEnd() {}
++  
++!     public void writeTime(Time o) {
++  
++          write('\'');
++          writeBytes(o.toString());
++          write('\'');
++      }
++  
++!     public void writeBinary(Binary o, int t) {
++  
++          ensureRoom(o.getBytesLength() * 2 + 2);
++          write('\'');
++***************
++*** 110,116 ****
++  
++      public void writeSize(int size) {}
++  
++!     protected void writeDate(Date o) {
++  
++          write('\'');
++          this.writeBytes(o.toString());
++--- 110,116 ----
++  
++      public void writeSize(int size) {}
++  
++!     public void writeDate(Date o) {
++  
++          write('\'');
++          this.writeBytes(o.toString());
++***************
++*** 121,136 ****
++          return 0;
++      }
++  
++!     protected void writeInteger(Number o) {
++          this.writeBytes(o.toString());
++      }
++  
++!     protected void writeBigint(Number o) {
++          this.writeBytes(o.toString());
++      }
++  
++  //fredt@users - patch 1108647 by nkowalcz@users (NataliaK) fix for IS NULL
++!     protected void writeNull(int type) {
++  
++          if (logMode == MODE_DELETE) {
++              write(BYTES_IS);
++--- 121,136 ----
++          return 0;
++      }
++  
++!     public void writeInteger(Number o) {
++          this.writeBytes(o.toString());
++      }
++  
++!     public void writeBigint(Number o) {
++          this.writeBytes(o.toString());
++      }
++  
++  //fredt@users - patch 1108647 by nkowalcz@users (NataliaK) fix for IS NULL
++!     public void writeNull(int type) {
++  
++          if (logMode == MODE_DELETE) {
++              write(BYTES_IS);
++***************
++*** 143,149 ****
++          write(BYTES_NULL);
++      }
++  
++!     protected void writeOther(JavaObject o) {
++  
++          ensureRoom(o.getBytesLength() * 2 + 2);
++          write('\'');
++--- 143,149 ----
++          write(BYTES_NULL);
++      }
++  
++!     public void writeOther(JavaObject o) {
++  
++          ensureRoom(o.getBytesLength() * 2 + 2);
++          write('\'');
++***************
++*** 158,173 ****
++          StringConverter.unicodeToAscii(this, value, false);
++      }
++  
++!     protected void writeBit(Boolean o) {
++          write(o.booleanValue() ? BYTES_TRUE
++                                 : BYTES_FALSE);
++      }
++  
++!     protected void writeDecimal(BigDecimal o) {
++          this.writeBytes(o.toString());
++      }
++  
++!     protected void writeFieldType(int type) {
++  
++          if (logMode == MODE_DELETE) {
++              write('=');
++--- 158,173 ----
++          StringConverter.unicodeToAscii(this, value, false);
++      }
++  
++!     public void writeBit(Boolean o) {
++          write(o.booleanValue() ? BYTES_TRUE
++                                 : BYTES_FALSE);
++      }
++  
++!     public void writeDecimal(BigDecimal o) {
++          this.writeBytes(o.toString());
++      }
++  
++!     public void writeFieldType(int type) {
++  
++          if (logMode == MODE_DELETE) {
++              write('=');
++***************
++*** 184,190 ****
++  
++      public void writeIntData(int i, int position) {}
++  
++!     protected void writeTimestamp(Timestamp o) {
++  
++          write('\'');
++          this.writeBytes(HsqlDateTime.getTimestampString(o));
++--- 184,190 ----
++  
++      public void writeIntData(int i, int position) {}
++  
++!     public void writeTimestamp(Timestamp o) {
++  
++          write('\'');
++          this.writeBytes(HsqlDateTime.getTimestampString(o));
++diff -crN hsqldb-old/src/org/hsqldb/rowio/RowOutputTextQuoted.java hsqldb/src/org/hsqldb/rowio/RowOutputTextQuoted.java
++*** hsqldb-old/src/org/hsqldb/rowio/RowOutputTextQuoted.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/rowio/RowOutputTextQuoted.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 49,55 ****
++          super(fieldSep, varSep, longvarSep, allQuoted, encoding);
++      }
++  
++!     protected String checkConvertString(String s, String sep) {
++  
++          if (allQuoted || s.length() == 0 || s.indexOf('\"') != -1
++                  || (sep.length() > 0 && s.indexOf(sep) != -1)
++--- 49,55 ----
++          super(fieldSep, varSep, longvarSep, allQuoted, encoding);
++      }
++  
++!     public String checkConvertString(String s, String sep) {
++  
++          if (allQuoted || s.length() == 0 || s.indexOf('\"') != -1
++                  || (sep.length() > 0 && s.indexOf(sep) != -1)
++***************
++*** 60,66 ****
++          return s;
++      }
++  
++!     private boolean hasUnprintable(String s) {
++  
++          for (int i = 0, len = s.length(); i < len; i++) {
++              if (Character.isISOControl(s.charAt(i))) {
++--- 60,66 ----
++          return s;
++      }
++  
++!     public boolean hasUnprintable(String s) {
++  
++          for (int i = 0, len = s.length(); i < len; i++) {
++              if (Character.isISOControl(s.charAt(i))) {
++diff -crN hsqldb-old/src/org/hsqldb/Row.java hsqldb/src/org/hsqldb/Row.java
++*** hsqldb-old/src/org/hsqldb/Row.java	2005-12-22 13:22:08.000000000 +0100
++--- hsqldb/src/org/hsqldb/Row.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 89,101 ****
++  
++      int                tableId;
++      int                iPos;
++!     protected Object[] oData;
++!     protected Node     nPrimaryNode;
++  
++      /**
++       *  Default constructor used only in subclasses.
++       */
++!     protected Row() {}
++  
++      /**
++       *  Constructor for MEMORY table Row. The result is a Row with Nodes that
++--- 89,101 ----
++  
++      int                tableId;
++      int                iPos;
++!     public Object[] oData;
++!     public Node     nPrimaryNode;
++  
++      /**
++       *  Default constructor used only in subclasses.
++       */
++!     public Row() {}
++  
++      /**
++       *  Constructor for MEMORY table Row. The result is a Row with Nodes that
++diff -crN hsqldb-old/src/org/hsqldb/sample/sample-hsqldb.cfg hsqldb/src/org/hsqldb/sample/sample-hsqldb.cfg
++*** hsqldb-old/src/org/hsqldb/sample/sample-hsqldb.cfg	2005-07-24 20:33:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/sample/sample-hsqldb.cfg	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 107,113 ****
++  # N.b.:  If you set these, then make this file unreadable to non-root users!!!!
++  # See the TLS chapter of the HSQLDB User Guide, paying attention to the 
++  # security warning(s).
++! # If you are running with a private server cert, then you will also need to 
++  # set "truststore" in the your SqlTool config file (location is set by the
++  # AUTH_FILE variable in this file, or it must be at the default location for 
++  # HSQLDB_OWNER).
++--- 107,113 ----
++  # N.b.:  If you set these, then make this file unreadable to non-root users!!!!
++  # See the TLS chapter of the HSQLDB User Guide, paying attention to the 
++  # security warning(s).
++! # If you are running with a public server cert, then you will also need to 
++  # set "truststore" in the your SqlTool config file (location is set by the
++  # AUTH_FILE variable in this file, or it must be at the default location for 
++  # HSQLDB_OWNER).
++***************
++*** 116,122 ****
++  
++  # Any JVM args for the invocation of the JDBC client used to verify DB
++  # instances and to shut them down (SqlToolSprayer).
++! # This example specifies the location of a private trust store for TLS 
++  # encryption.
++  # For multiple args, put quotes around entire value.
++  #CLIENT_JVMARGS=-Djavax.net.debug=ssl
++--- 116,122 ----
++  
++  # Any JVM args for the invocation of the JDBC client used to verify DB
++  # instances and to shut them down (SqlToolSprayer).
++! # This example specifies the location of a public trust store for TLS 
++  # encryption.
++  # For multiple args, put quotes around entire value.
++  #CLIENT_JVMARGS=-Djavax.net.debug=ssl
++diff -crN hsqldb-old/src/org/hsqldb/sample/TriggerSample.java hsqldb/src/org/hsqldb/sample/TriggerSample.java
++*** hsqldb-old/src/org/hsqldb/sample/TriggerSample.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/sample/TriggerSample.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 211,217 ****
++          }
++      }
++  
++!     private static void doAssert(boolean b,
++                                   String msg) throws RuntimeException {
++  
++          if (b) {
++--- 211,217 ----
++          }
++      }
++  
++!     public static void doAssert(boolean b,
++                                   String msg) throws RuntimeException {
++  
++          if (b) {
++***************
++*** 224,230 ****
++          }
++      }
++  
++!     private static void doAuditStep(int typ, String tn, String ors,
++                                      String nrs) {
++  
++          Connection        conn;
++--- 224,230 ----
++          }
++      }
++  
++!     public static void doAuditStep(int typ, String tn, String ors,
++                                      String nrs) {
++  
++          Connection        conn;
++***************
++*** 373,379 ****
++          return sb.toString();
++      }
++  
++!     private static Connection getConnection() throws SQLException {
++  
++          try {
++              Class.forName(drv).newInstance();
++--- 373,379 ----
++          return sb.toString();
++      }
++  
++!     public static Connection getConnection() throws SQLException {
++  
++          try {
++              Class.forName(drv).newInstance();
++***************
++*** 386,397 ****
++          }
++      }
++  
++!     private static void createTrigger(Statement stmt, String trn,
++                                        int typ) throws SQLException {
++          stmt.execute(getTriggerDDL(trn, typ, tn, 0, impl));
++      }
++  
++!     private static void setup() throws SQLException {
++  
++          Connection conn = getConnection();
++          Statement  stmt = conn.createStatement();
++--- 386,397 ----
++          }
++      }
++  
++!     public static void createTrigger(Statement stmt, String trn,
++                                        int typ) throws SQLException {
++          stmt.execute(getTriggerDDL(trn, typ, tn, 0, impl));
++      }
++  
++!     public static void setup() throws SQLException {
++  
++          Connection conn = getConnection();
++          Statement  stmt = conn.createStatement();
++***************
++*** 416,422 ****
++          conn.close();
++      }
++  
++!     private static void doSomeWork() throws SQLException {
++  
++          Connection conn = getConnection();
++          Statement  stmt = conn.createStatement();
++--- 416,422 ----
++          conn.close();
++      }
++  
++!     public static void doSomeWork() throws SQLException {
++  
++          Connection conn = getConnection();
++          Statement  stmt = conn.createStatement();
++***************
++*** 448,454 ****
++          conn.close();
++      }
++  
++!     private static void dumpTable(String tn) throws SQLException {
++  
++          Connection        conn  = getConnection();
++          Statement         stmt  = conn.createStatement();
++--- 448,454 ----
++          conn.close();
++      }
++  
++!     public static void dumpTable(String tn) throws SQLException {
++  
++          Connection        conn  = getConnection();
++          Statement         stmt  = conn.createStatement();
++***************
++*** 483,489 ****
++          conn.close();
++      }
++  
++!     private static void runSample() throws SQLException {
++  
++          setup();
++          doSomeWork();
++--- 483,489 ----
++          conn.close();
++      }
++  
++!     public static void runSample() throws SQLException {
++  
++          setup();
++          doSomeWork();
++diff -crN hsqldb-old/src/org/hsqldb/SchemaManager.java hsqldb/src/org/hsqldb/SchemaManager.java
++*** hsqldb-old/src/org/hsqldb/SchemaManager.java	2007-07-09 10:49:26.000000000 +0200
++--- hsqldb/src/org/hsqldb/SchemaManager.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 780,786 ****
++      /**
++       * Throws if the table is referenced in a foreign key constraint.
++       */
++!     private void checkCascadeDropReferenced(Table table,
++              boolean cascade) throws HsqlException {
++  
++          Constraint[] constraints       = table.getConstraints();
++--- 780,786 ----
++      /**
++       * Throws if the table is referenced in a foreign key constraint.
++       */
++!     public void checkCascadeDropReferenced(Table table,
++              boolean cascade) throws HsqlException {
++  
++          Constraint[] constraints       = table.getConstraints();
++***************
++*** 903,909 ****
++      /**
++       * Returns an array of views that reference another view.
++       */
++!     private View[] getViewsWithView(View view) {
++  
++          HsqlArrayList list   = null;
++          Schema        schema = (Schema) schemaMap.get(view.getSchemaName());
++--- 903,909 ----
++      /**
++       * Returns an array of views that reference another view.
++       */
++!     public View[] getViewsWithView(View view) {
++  
++          HsqlArrayList list   = null;
++          Schema        schema = (Schema) schemaMap.get(view.getSchemaName());
++***************
++*** 932,938 ****
++       * Returns an array of views that reference the specified table or
++       * the specified column if column parameter is not null.
++       */
++!     private View[] getViewsWithTable(Table table, String column) {
++  
++          HsqlArrayList list = null;
++          Iterator      it   = allTablesIterator();
++--- 932,938 ----
++       * Returns an array of views that reference the specified table or
++       * the specified column if column parameter is not null.
++       */
++!     public View[] getViewsWithTable(Table table, String column) {
++  
++          HsqlArrayList list = null;
++          Iterator      it   = allTablesIterator();
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderBase.java hsqldb/src/org/hsqldb/scriptio/ScriptReaderBase.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderBase.java	2007-06-21 15:28:04.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptReaderBase.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 82,98 ****
++          openFile();
++      }
++  
++!     protected abstract void openFile() throws IOException;
++  
++      public void readAll(Session session) throws IOException, HsqlException {
++          readDDL(session);
++          readExistingData(session);
++      }
++  
++!     protected abstract void readDDL(Session session)
++      throws IOException, HsqlException;
++  
++!     protected abstract void readExistingData(Session session)
++      throws IOException, HsqlException;
++  
++      public abstract boolean readLoggedStatement(Session session)
++--- 82,98 ----
++          openFile();
++      }
++  
++!     public abstract void openFile() throws IOException;
++  
++      public void readAll(Session session) throws IOException, HsqlException {
++          readDDL(session);
++          readExistingData(session);
++      }
++  
++!     public abstract void readDDL(Session session)
++      throws IOException, HsqlException;
++  
++!     public abstract void readExistingData(Session session)
++      throws IOException, HsqlException;
++  
++      public abstract boolean readLoggedStatement(Session session)
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderBinary.java hsqldb/src/org/hsqldb/scriptio/ScriptReaderBinary.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderBinary.java	2006-09-24 17:37:58.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptReaderBinary.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 58,65 ****
++   */
++  class ScriptReaderBinary extends ScriptReaderBase {
++  
++!     private RowInputBinary    rowIn;
++!     protected DataInputStream dataStreamIn;
++  
++      ScriptReaderBinary(Database db,
++                         String file) throws HsqlException, IOException {
++--- 58,65 ----
++   */
++  class ScriptReaderBinary extends ScriptReaderBase {
++  
++!     public RowInputBinary    rowIn;
++!     public DataInputStream dataStreamIn;
++  
++      ScriptReaderBinary(Database db,
++                         String file) throws HsqlException, IOException {
++***************
++*** 69,75 ****
++          rowIn = new RowInputBinary();
++      }
++  
++!     protected void openFile() throws IOException {
++  
++          InputStream d = db.isFilesInJar()
++                          ? getClass().getResourceAsStream(fileName)
++--- 69,75 ----
++          rowIn = new RowInputBinary();
++      }
++  
++!     public void openFile() throws IOException {
++  
++          InputStream d = db.isFilesInJar()
++                          ? getClass().getResourceAsStream(fileName)
++***************
++*** 79,85 ****
++                  1 << 13));
++      }
++  
++!     protected void readDDL(Session session)
++      throws IOException, HsqlException {
++  
++          Result   r  = Result.read(rowIn, dataStreamIn);
++--- 79,85 ----
++                  1 << 13));
++      }
++  
++!     public void readDDL(Session session)
++      throws IOException, HsqlException {
++  
++          Result   r  = Result.read(rowIn, dataStreamIn);
++***************
++*** 100,106 ****
++          }
++      }
++  
++!     protected void readExistingData(Session session)
++      throws IOException, HsqlException {
++  
++          for (;;) {
++--- 100,106 ----
++          }
++      }
++  
++!     public void readExistingData(Session session)
++      throws IOException, HsqlException {
++  
++          for (;;) {
++***************
++*** 134,140 ****
++  
++      // int : row size (0 if no more rows) ,
++      // BinaryServerRowInput : row (column values)
++!     protected boolean readRow(Table t) throws IOException, HsqlException {
++  
++          boolean more = readRow(rowIn, 0);
++  
++--- 134,140 ----
++  
++      // int : row size (0 if no more rows) ,
++      // BinaryServerRowInput : row (column values)
++!     public boolean readRow(Table t) throws IOException, HsqlException {
++  
++          boolean more = readRow(rowIn, 0);
++  
++***************
++*** 150,162 ****
++      }
++  
++      // int : rowcount
++!     protected int readTableTerm() throws IOException, HsqlException {
++          return dataStreamIn.readInt();
++      }
++  
++      // int : headersize (0 if no more tables), String : tablename, int : operation,
++      // String : schemaname
++!     protected String readTableInit() throws IOException, HsqlException {
++  
++          boolean more = readRow(rowIn, 0);
++  
++--- 150,162 ----
++      }
++  
++      // int : rowcount
++!     public int readTableTerm() throws IOException, HsqlException {
++          return dataStreamIn.readInt();
++      }
++  
++      // int : headersize (0 if no more tables), String : tablename, int : operation,
++      // String : schemaname
++!     public String readTableInit() throws IOException, HsqlException {
++  
++          boolean more = readRow(rowIn, 0);
++  
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderText.java hsqldb/src/org/hsqldb/scriptio/ScriptReaderText.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderText.java	2007-06-21 15:28:16.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptReaderText.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 70,76 ****
++          rowIn = new RowInputTextLog();
++      }
++  
++!     protected void openFile() throws IOException {
++  
++          InputStream d = db.isFilesInJar()
++                          ? getClass().getResourceAsStream(fileName)
++--- 70,76 ----
++          rowIn = new RowInputTextLog();
++      }
++  
++!     public void openFile() throws IOException {
++  
++          InputStream d = db.isFilesInJar()
++                          ? getClass().getResourceAsStream(fileName)
++***************
++*** 80,86 ****
++              new InputStreamReader(new BufferedInputStream(d)));
++      }
++  
++!     protected void readDDL(Session session) throws IOException, HsqlException {
++  
++          for (; readLoggedStatement(session); ) {
++              if (rowIn.getStatementType() == INSERT_STATEMENT) {
++--- 80,86 ----
++              new InputStreamReader(new BufferedInputStream(d)));
++      }
++  
++!     public void readDDL(Session session) throws IOException, HsqlException {
++  
++          for (; readLoggedStatement(session); ) {
++              if (rowIn.getStatementType() == INSERT_STATEMENT) {
++***************
++*** 108,114 ****
++          }
++      }
++  
++!     protected void readExistingData(Session session)
++      throws IOException, HsqlException {
++  
++          try {
++--- 108,114 ----
++          }
++      }
++  
++!     public void readExistingData(Session session)
++      throws IOException, HsqlException {
++  
++          try {
++***************
++*** 168,174 ****
++          return true;
++      }
++  
++!     private void processStatement(Session session) throws IOException {
++  
++          try {
++              if (statement.startsWith("/*C")) {
++--- 168,174 ----
++          return true;
++      }
++  
++!     public void processStatement(Session session) throws IOException {
++  
++          try {
++              if (statement.startsWith("/*C")) {
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderZipped.java hsqldb/src/org/hsqldb/scriptio/ScriptReaderZipped.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptReaderZipped.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptReaderZipped.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 54,60 ****
++          super(db, file);
++      }
++  
++!     protected void openFile() throws IOException {
++  
++          InputStream d = db.isFilesInJar()
++                          ? getClass().getResourceAsStream(fileName)
++--- 54,60 ----
++          super(db, file);
++      }
++  
++!     public void openFile() throws IOException {
++  
++          InputStream d = db.isFilesInJar()
++                          ? getClass().getResourceAsStream(fileName)
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterBase.java hsqldb/src/org/hsqldb/scriptio/ScriptWriterBase.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterBase.java	2007-10-11 11:32:18.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptWriterBase.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 101,107 ****
++      volatile boolean needsSync;
++      volatile boolean forceSync;
++      volatile boolean busyWriting;
++!     private int      syncCount;
++      static final int INSERT             = 0;
++      static final int INSERT_WITH_SCHEMA = 1;
++  
++--- 101,107 ----
++      volatile boolean needsSync;
++      volatile boolean forceSync;
++      volatile boolean busyWriting;
++!     public int      syncCount;
++      static final int INSERT             = 0;
++      static final int INSERT_WITH_SCHEMA = 1;
++  
++***************
++*** 167,173 ****
++          openFile();
++      }
++  
++!     protected abstract void initBuffers();
++  
++      /**
++       *  Called internally or externally in write delay intervals.
++--- 167,173 ----
++          openFile();
++      }
++  
++!     public abstract void initBuffers();
++  
++      /**
++       *  Called internally or externally in write delay intervals.
++***************
++*** 234,240 ****
++       *  File is opened in append mode although in current usage the file
++       *  never pre-exists
++       */
++!     protected void openFile() throws HsqlException {
++  
++          try {
++              FileAccess   fa  = isDump ? FileUtil.getDefaultInstance()
++--- 234,240 ----
++       *  File is opened in append mode although in current usage the file
++       *  never pre-exists
++       */
++!     public void openFile() throws HsqlException {
++  
++          try {
++              FileAccess   fa  = isDump ? FileUtil.getDefaultInstance()
++***************
++*** 255,263 ****
++       * This is not really useful in the current usage but may be if this
++       * class is used in a different way.
++       */
++!     protected void finishStream() throws IOException {}
++  
++!     protected void writeDDL() throws IOException, HsqlException {
++  
++          Result ddlPart = DatabaseScript.getScript(database,
++              !includeCachedData);
++--- 255,263 ----
++       * This is not really useful in the current usage but may be if this
++       * class is used in a different way.
++       */
++!     public void finishStream() throws IOException {}
++  
++!     public void writeDDL() throws IOException, HsqlException {
++  
++          Result ddlPart = DatabaseScript.getScript(database,
++              !includeCachedData);
++***************
++*** 265,271 ****
++          writeSingleColumnResult(ddlPart);
++      }
++  
++!     protected void writeExistingData() throws HsqlException, IOException {
++  
++          // start with blank schema - SET SCHEMA to log
++          currentSession.loggedSchema = null;
++--- 265,271 ----
++          writeSingleColumnResult(ddlPart);
++      }
++  
++!     public void writeExistingData() throws HsqlException, IOException {
++  
++          // start with blank schema - SET SCHEMA to log
++          currentSession.loggedSchema = null;
++***************
++*** 323,332 ****
++          writeDataTerm();
++      }
++  
++!     protected void writeTableInit(Table t)
++      throws HsqlException, IOException {}
++  
++!     protected void writeTableTerm(Table t) throws HsqlException, IOException {
++  
++          if (t.isDataReadOnly() &&!t.isTemp() &&!t.isText()) {
++              StringBuffer a = new StringBuffer("SET TABLE ");
++--- 323,332 ----
++          writeDataTerm();
++      }
++  
++!     public void writeTableInit(Table t)
++      throws HsqlException, IOException {}
++  
++!     public void writeTableTerm(Table t) throws HsqlException, IOException {
++  
++          if (t.isDataReadOnly() &&!t.isTemp() &&!t.isText()) {
++              StringBuffer a = new StringBuffer("SET TABLE ");
++***************
++*** 337,343 ****
++          }
++      }
++  
++!     protected void writeSingleColumnResult(Result r)
++      throws HsqlException, IOException {
++  
++          Iterator it = r.iterator();
++--- 337,343 ----
++          }
++      }
++  
++!     public void writeSingleColumnResult(Result r)
++      throws HsqlException, IOException {
++  
++          Iterator it = r.iterator();
++***************
++*** 352,360 ****
++      abstract void writeRow(Session session, Table table,
++                             Object[] data) throws HsqlException, IOException;
++  
++!     protected abstract void writeDataTerm() throws IOException;
++  
++!     protected abstract void addSessionId(Session session) throws IOException;
++  
++      public abstract void writeLogStatement(Session session,
++                                             String s)
++--- 352,360 ----
++      abstract void writeRow(Session session, Table table,
++                             Object[] data) throws HsqlException, IOException;
++  
++!     public abstract void writeDataTerm() throws IOException;
++  
++!     public abstract void addSessionId(Session session) throws IOException;
++  
++      public abstract void writeLogStatement(Session session,
++                                             String s)
++***************
++*** 373,382 ****
++      throws HsqlException, IOException;
++  
++      //
++!     private Object timerTask;
++  
++      // long write delay for scripts : 60s
++!     protected volatile int writeDelay = 60000;
++  
++      public void run() {
++  
++--- 373,382 ----
++      throws HsqlException, IOException;
++  
++      //
++!     public Object timerTask;
++  
++      // long write delay for scripts : 60s
++!     public volatile int writeDelay = 60000;
++  
++      public void run() {
++  
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterBinary.java hsqldb/src/org/hsqldb/scriptio/ScriptWriterBinary.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterBinary.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptWriterBinary.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 55,72 ****
++          super(db, file, includeCached, newFile, false);
++      }
++  
++!     protected void initBuffers() {
++          rowOut = new RowOutputBinary();
++      }
++  
++!     protected void writeSingleColumnResult(Result r)
++      throws IOException, HsqlException {
++          Result.write(r, rowOut, fileStreamOut);
++      }
++  
++      // int : row size (0 if no more rows) ,
++      // RowInput/OutputBinary : row (column values)
++!     protected void writeRow(Session session, Table t,
++                              Object[] data) throws IOException, HsqlException {
++  
++          rowOut.reset();
++--- 55,72 ----
++          super(db, file, includeCached, newFile, false);
++      }
++  
++!     public void initBuffers() {
++          rowOut = new RowOutputBinary();
++      }
++  
++!     public void writeSingleColumnResult(Result r)
++      throws IOException, HsqlException {
++          Result.write(r, rowOut, fileStreamOut);
++      }
++  
++      // int : row size (0 if no more rows) ,
++      // RowInput/OutputBinary : row (column values)
++!     public void writeRow(Session session, Table t,
++                              Object[] data) throws IOException, HsqlException {
++  
++          rowOut.reset();
++***************
++*** 77,83 ****
++      }
++  
++      // int : headersize (0 if no more tables), String : tablename, int : operation,
++!     protected void writeTableInit(Table t) throws HsqlException, IOException {
++  
++          tableRowCount = 0;
++  
++--- 77,83 ----
++      }
++  
++      // int : headersize (0 if no more tables), String : tablename, int : operation,
++!     public void writeTableInit(Table t) throws HsqlException, IOException {
++  
++          tableRowCount = 0;
++  
++***************
++*** 90,96 ****
++          fileStreamOut.write(rowOut.getBuffer(), 0, rowOut.size());
++      }
++  
++!     protected void writeTableTerm(Table t) throws IOException {
++  
++          rowOut.reset();
++          rowOut.writeSize(0);
++--- 90,96 ----
++          fileStreamOut.write(rowOut.getBuffer(), 0, rowOut.size());
++      }
++  
++!     public void writeTableTerm(Table t) throws IOException {
++  
++          rowOut.reset();
++          rowOut.writeSize(0);
++***************
++*** 98,104 ****
++          fileStreamOut.write(rowOut.getBuffer(), 0, rowOut.size());
++      }
++  
++!     protected void writeDataTerm() throws IOException {
++  
++          rowOut.reset();
++          rowOut.writeSize(0);
++--- 98,104 ----
++          fileStreamOut.write(rowOut.getBuffer(), 0, rowOut.size());
++      }
++  
++!     public void writeDataTerm() throws IOException {
++  
++          rowOut.reset();
++          rowOut.writeSize(0);
++***************
++*** 109,115 ****
++                                    String s)
++                                    throws IOException, HsqlException {}
++  
++!     protected void addSessionId(Session session) throws IOException {}
++  
++      public void writeDeleteStatement(Session session, Table table,
++                                       Object[] ddata)
++--- 109,115 ----
++                                    String s)
++                                    throws IOException, HsqlException {}
++  
++!     public void addSessionId(Session session) throws IOException {}
++  
++      public void writeDeleteStatement(Session session, Table table,
++                                       Object[] ddata)
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterText.java hsqldb/src/org/hsqldb/scriptio/ScriptWriterText.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterText.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptWriterText.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 96,108 ****
++          super(db, file, includeCachedData, newFile, isDump);
++      }
++  
++!     protected void initBuffers() {
++          rowOut = new RowOutputTextLog();
++      }
++  
++!     protected void writeDataTerm() throws IOException {}
++  
++!     protected void addSessionId(Session session) throws IOException {
++  
++          if (session == null) {
++              return;
++--- 96,108 ----
++          super(db, file, includeCachedData, newFile, isDump);
++      }
++  
++!     public void initBuffers() {
++          rowOut = new RowOutputTextLog();
++      }
++  
++!     public void writeDataTerm() throws IOException {}
++  
++!     public void addSessionId(Session session) throws IOException {
++  
++          if (session == null) {
++              return;
++***************
++*** 123,129 ****
++          }
++      }
++  
++!     private void writeSchemaStatement(HsqlName schema) {
++  
++          rowOut.write(BYTES_SCHEMA);
++          rowOut.writeString(schema.statementName);
++--- 123,129 ----
++          }
++      }
++  
++!     public void writeSchemaStatement(HsqlName schema) {
++  
++          rowOut.write(BYTES_SCHEMA);
++          rowOut.writeString(schema.statementName);
++***************
++*** 152,158 ****
++          }
++      }
++  
++!     protected void writeRow(Session session, Table table,
++                              Object[] data) throws HsqlException, IOException {
++  
++          busyWriting = true;
++--- 152,158 ----
++          }
++      }
++  
++!     public void writeRow(Session session, Table table,
++                              Object[] data) throws HsqlException, IOException {
++  
++          busyWriting = true;
++***************
++*** 177,183 ****
++          }
++      }
++  
++!     protected void writeTableInit(Table t) throws HsqlException, IOException {
++  
++          if (t.isEmpty(currentSession)) {
++              return;
++--- 177,183 ----
++          }
++      }
++  
++!     public void writeTableInit(Table t) throws HsqlException, IOException {
++  
++          if (t.isEmpty(currentSession)) {
++              return;
++***************
++*** 275,281 ****
++          }
++      }
++  
++!     protected void finalize() {
++          sync();
++      }
++  }
++--- 275,281 ----
++          }
++      }
++  
++!     public void finalize() {
++          sync();
++      }
++  }
++diff -crN hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterZipped.java hsqldb/src/org/hsqldb/scriptio/ScriptWriterZipped.java
++*** hsqldb-old/src/org/hsqldb/scriptio/ScriptWriterZipped.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/scriptio/ScriptWriterZipped.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 48,54 ****
++   */
++  class ScriptWriterZipped extends ScriptWriterBinary {
++  
++!     private static final int bufferSize = 1 << 15;
++  
++      ScriptWriterZipped(Database db, String file, boolean includeCached,
++                         boolean newFile) throws HsqlException {
++--- 48,54 ----
++   */
++  class ScriptWriterZipped extends ScriptWriterBinary {
++  
++!     public static final int bufferSize = 1 << 15;
++  
++      ScriptWriterZipped(Database db, String file, boolean includeCached,
++                         boolean newFile) throws HsqlException {
++***************
++*** 60,66 ****
++       */
++      public void sync() {}
++  
++!     protected void openFile() throws HsqlException {
++  
++          try {
++              FileAccess           fa  = database.getFileAccess();
++--- 60,66 ----
++       */
++      public void sync() {}
++  
++!     public void openFile() throws HsqlException {
++  
++          try {
++              FileAccess           fa  = database.getFileAccess();
++***************
++*** 81,87 ****
++       * This may not really be necessary, unless we add implementations where
++       * non-compressed data is added to the end of the copressed part.
++       */
++!     protected void finishStream() throws IOException {
++          ((DeflaterOutputStream) fileStreamOut).finish();
++          fileStreamOut.flush();
++      }
++--- 81,87 ----
++       * This may not really be necessary, unless we add implementations where
++       * non-compressed data is added to the end of the copressed part.
++       */
++!     public void finishStream() throws IOException {
++          ((DeflaterOutputStream) fileStreamOut).finish();
++          fileStreamOut.flush();
++      }
++diff -crN hsqldb-old/src/org/hsqldb/Select.java hsqldb/src/org/hsqldb/Select.java
++*** hsqldb-old/src/org/hsqldb/Select.java	2007-07-23 20:30:48.000000000 +0200
++--- hsqldb/src/org/hsqldb/Select.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 102,109 ****
++  
++      boolean               isDistinctSelect;
++      boolean               isAggregated;
++!     private boolean       isGrouped;
++!     private HashSet       groupColumnNames;
++      TableFilter[]         tFilter;
++      Expression            limitCondition;
++      Expression            queryCondition;     // null means no condition
++--- 102,109 ----
++  
++      boolean               isDistinctSelect;
++      boolean               isAggregated;
++!     public boolean       isGrouped;
++!     public HashSet       groupColumnNames;
++      TableFilter[]         tFilter;
++      Expression            limitCondition;
++      Expression            queryCondition;     // null means no condition
++***************
++*** 128,134 ****
++                            UNIONALL  = 2,
++                            INTERSECT = 3,
++                            EXCEPT    = 4;
++!     private boolean       simpleLimit;        // true if maxrows can be uses as is
++      Result.ResultMetaData resultMetaData;
++      IntKeyHashMap         asteriskPositions;
++  
++--- 128,134 ----
++                            UNIONALL  = 2,
++                            INTERSECT = 3,
++                            EXCEPT    = 4;
++!     public boolean       simpleLimit;        // true if maxrows can be uses as is
++      Result.ResultMetaData resultMetaData;
++      IntKeyHashMap         asteriskPositions;
++  
++***************
++*** 173,179 ****
++       *
++       * @throws HsqlException
++       */
++!     private void resolveTables() throws HsqlException {
++  
++          // replace the aliases with expressions
++          for (int i = iResultLen; i < exprColumns.length; i++) {
++--- 173,179 ----
++       *
++       * @throws HsqlException
++       */
++!     public void resolveTables() throws HsqlException {
++  
++          // replace the aliases with expressions
++          for (int i = iResultLen; i < exprColumns.length; i++) {
++***************
++*** 279,285 ****
++          }
++      }
++  
++!     private void setFilterConditions(Session session) throws HsqlException {
++  
++          if (queryCondition == null) {
++              return;
++--- 279,285 ----
++          }
++      }
++  
++!     public void setFilterConditions(Session session) throws HsqlException {
++  
++          if (queryCondition == null) {
++              return;
++***************
++*** 534,540 ****
++          return r;
++      }
++  
++!     private Result getResultMain(Session session) throws HsqlException {
++  
++          Result[] unionResults = new Result[unionArray.length];
++  
++--- 534,540 ----
++          return r;
++      }
++  
++!     public Result getResultMain(Session session) throws HsqlException {
++  
++          Result[] unionResults = new Result[unionArray.length];
++  
++***************
++*** 589,595 ****
++       * Merges the second result into the first using the unionMode
++       * set operation.
++       */
++!     private void mergeResults(Session session, Result first,
++                                Result second) throws HsqlException {
++  
++          switch (unionType) {
++--- 589,595 ----
++       * Merges the second result into the first using the unionMode
++       * set operation.
++       */
++!     public void mergeResults(Session session, Result first,
++                                Result second) throws HsqlException {
++  
++          switch (unionType) {
++***************
++*** 678,684 ****
++          return rowCount;
++      }
++  
++!     private Result getSingleResult(Session session,
++                                     int rowCount) throws HsqlException {
++  
++          if (resultMetaData == null) {
++--- 678,684 ----
++          return rowCount;
++      }
++  
++!     public Result getSingleResult(Session session,
++                                     int rowCount) throws HsqlException {
++  
++          if (resultMetaData == null) {
++***************
++*** 702,708 ****
++          return r;
++      }
++  
++!     private void prepareSort() {
++  
++          if (iOrderLen == 0) {
++              return;
++--- 702,708 ----
++          return r;
++      }
++  
++!     public void prepareSort() {
++  
++          if (iOrderLen == 0) {
++              return;
++***************
++*** 728,734 ****
++          }
++      }
++  
++!     private void sortResult(Session session, Result r) throws HsqlException {
++  
++          if (iOrderLen == 0) {
++              return;
++--- 728,734 ----
++          }
++      }
++  
++!     public void sortResult(Session session, Result r) throws HsqlException {
++  
++          if (iOrderLen == 0) {
++              return;
++***************
++*** 742,748 ****
++       * If any result column is aggregated, then all result columns need to be
++       * aggregated, unless it is included in the group by clause.
++       */
++!     private void checkAggregateOrGroupByColumns(int start,
++              int end) throws HsqlException {
++  
++          if (start < end) {
++--- 742,748 ----
++       * If any result column is aggregated, then all result columns need to be
++       * aggregated, unless it is included in the group by clause.
++       */
++!     public void checkAggregateOrGroupByColumns(int start,
++              int end) throws HsqlException {
++  
++          if (start < end) {
++***************
++*** 764,770 ****
++          }
++      }
++  
++!     private void checkAggregateOrGroupByOrderColumns(int start,
++              int end) throws HsqlException {
++  
++          checkAggregateOrGroupByColumns(start, end);
++--- 764,770 ----
++          }
++      }
++  
++!     public void checkAggregateOrGroupByOrderColumns(int start,
++              int end) throws HsqlException {
++  
++          checkAggregateOrGroupByColumns(start, end);
++***************
++*** 801,807 ****
++       * <LI>All the columns in the expression are defined in the group by clause;
++       * </UL)
++       */
++!     private boolean inAggregateOrGroupByClause(Expression exp) {
++  
++          if (isGrouped) {
++              return isSimilarIn(exp, iResultLen, iResultLen + iGroupLen)
++--- 801,807 ----
++       * <LI>All the columns in the expression are defined in the group by clause;
++       * </UL)
++       */
++!     public boolean inAggregateOrGroupByClause(Expression exp) {
++  
++          if (isGrouped) {
++              return isSimilarIn(exp, iResultLen, iResultLen + iGroupLen)
++***************
++*** 817,823 ****
++       * Check if the given expression is similar to any of the eColumn
++       * expressions within the given range.
++       */
++!     private boolean isSimilarIn(Expression exp, int start, int end) {
++  
++          for (int i = start; i < end; i++) {
++              if (exp.similarTo(exprColumns[i])) {
++--- 817,823 ----
++       * Check if the given expression is similar to any of the eColumn
++       * expressions within the given range.
++       */
++!     public boolean isSimilarIn(Expression exp, int start, int end) {
++  
++          for (int i = start; i < end; i++) {
++              if (exp.similarTo(exprColumns[i])) {
++***************
++*** 855,861 ****
++      }
++  
++  // fredt@users 20030810 - patch 1.7.2 - OUTER JOIN rewrite
++!     private Result buildResult(Session session,
++                                 int limitcount) throws HsqlException {
++  
++          GroupedResult gResult   = new GroupedResult(this, resultMetaData);
++--- 855,861 ----
++      }
++  
++  // fredt@users 20030810 - patch 1.7.2 - OUTER JOIN rewrite
++!     public Result buildResult(Session session,
++                                 int limitcount) throws HsqlException {
++  
++          GroupedResult gResult   = new GroupedResult(this, resultMetaData);
++diff -crN hsqldb-old/src/org/hsqldb/ServerConfiguration.java hsqldb/src/org/hsqldb/ServerConfiguration.java
++*** hsqldb-old/src/org/hsqldb/ServerConfiguration.java	2007-10-16 08:56:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/ServerConfiguration.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 49,55 ****
++   */
++  public final class ServerConfiguration implements ServerConstants {
++  
++!     private ServerConfiguration() {}
++  
++      /**
++       * Retrieves the default port that a Server will try to use in the
++--- 49,55 ----
++   */
++  public final class ServerConfiguration implements ServerConstants {
++  
++!     public ServerConfiguration() {}
++  
++      /**
++       * Retrieves the default port that a Server will try to use in the
++diff -crN hsqldb-old/src/org/hsqldb/ServerConnection.java hsqldb/src/org/hsqldb/ServerConnection.java
++*** hsqldb-old/src/org/hsqldb/ServerConnection.java	2007-06-11 12:12:28.000000000 +0200
++--- hsqldb/src/org/hsqldb/ServerConnection.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 85,91 ****
++   *  and removed by this class when closed.<p>
++   *
++   *  When the database or server is shutdown, the signalClose() method is called
++!  *  for all current ServerConnection instances. This will call the private
++   *  close() method unless the ServerConnection thread itself has caused the
++   *  shutdown. In this case, the keepAlive flag is set to false, allowing the
++   *  thread to terminate once it has returned the result of the operation to
++--- 85,91 ----
++   *  and removed by this class when closed.<p>
++   *
++   *  When the database or server is shutdown, the signalClose() method is called
++!  *  for all current ServerConnection instances. This will call the public
++   *  close() method unless the ServerConnection thread itself has caused the
++   *  shutdown. In this case, the keepAlive flag is set to false, allowing the
++   *  thread to terminate once it has returned the result of the operation to
++***************
++*** 102,117 ****
++  class ServerConnection implements Runnable {
++  
++      boolean                      keepAlive;
++!     private String               user;
++!     private String               password;
++      int                          dbID;
++!     private volatile Session     session;
++!     private Socket               socket;
++!     private Server               server;
++!     private DataInputStream      dataInput;
++!     private BufferedOutputStream dataOutput;
++!     private static int           mCurrentThread = 0;
++!     private int                  mThread;
++      static final int             BUFFER_SIZE = 0x1000;
++      final byte[]                 mainBuffer  = new byte[BUFFER_SIZE];
++      RowOutputBinary              rowOut = new RowOutputBinary(BUFFER_SIZE);
++--- 102,117 ----
++  class ServerConnection implements Runnable {
++  
++      boolean                      keepAlive;
++!     public String               user;
++!     public String               password;
++      int                          dbID;
++!     public volatile Session     session;
++!     public Socket               socket;
++!     public Server               server;
++!     public DataInputStream      dataInput;
++!     public BufferedOutputStream dataOutput;
++!     public static int           mCurrentThread = 0;
++!     public int                  mThread;
++      static final int             BUFFER_SIZE = 0x1000;
++      final byte[]                 mainBuffer  = new byte[BUFFER_SIZE];
++      RowOutputBinary              rowOut = new RowOutputBinary(BUFFER_SIZE);
++***************
++*** 157,163 ****
++      /**
++       * Closes this connection.
++       */
++!     private void close() {
++  
++          if (session != null) {
++              session.close();
++--- 157,163 ----
++      /**
++       * Closes this connection.
++       */
++!     public void close() {
++  
++          if (session != null) {
++              session.close();
++***************
++*** 180,186 ****
++      /**
++       * Initializes this connection.
++       */
++!     private void init() {
++  
++          runnerThread = Thread.currentThread();
++          keepAlive    = true;
++--- 180,186 ----
++      /**
++       * Initializes this connection.
++       */
++!     public void init() {
++  
++          runnerThread = Thread.currentThread();
++          keepAlive    = true;
++***************
++*** 274,280 ****
++       * Used by pooled connections to close the existing SQL session and open
++       * a new one.
++       */
++!     private Result resetSession() {
++  
++          Result resultOut;
++  
++--- 274,280 ----
++       * Used by pooled connections to close the existing SQL session and open
++       * a new one.
++       */
++!     public Result resetSession() {
++  
++          Result resultOut;
++  
++diff -crN hsqldb-old/src/org/hsqldb/Server.java hsqldb/src/org/hsqldb/Server.java
++*** hsqldb-old/src/org/hsqldb/Server.java	2007-10-11 11:32:16.000000000 +0200
++--- hsqldb/src/org/hsqldb/Server.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 234,240 ****
++  public class Server implements HsqlSocketRequestHandler {
++  
++  //
++!     protected static final int serverBundleHandle =
++          BundleHandler.getBundleHandle("org_hsqldb_Server_messages", null);
++  
++  //
++--- 234,240 ----
++  public class Server implements HsqlSocketRequestHandler {
++  
++  //
++!     public static final int serverBundleHandle =
++          BundleHandler.getBundleHandle("org_hsqldb_Server_messages", null);
++  
++  //
++***************
++*** 244,273 ****
++      HashSet serverConnSet;
++  
++  //
++!     private String[]         dbAlias;
++!     private String[]         dbType;
++!     private String[]         dbPath;
++!     private HsqlProperties[] dbProps;
++!     private int[]            dbID;
++  
++  //  Currently unused
++!     private int maxConnections;
++  
++  //
++!     protected String            serverId;
++!     protected int               serverProtocol;
++!     protected ThreadGroup       serverConnectionThreadGroup;
++!     protected HsqlSocketFactory socketFactory;
++!     protected ServerSocket      socket;
++  
++  //
++!     private Thread           serverThread;
++!     private Throwable        serverError;
++!     private volatile int     serverState;
++!     private volatile boolean isSilent;
++!     private volatile boolean isRemoteOpen;
++!     private PrintWriter      logWriter;
++!     private PrintWriter      errWriter;
++  
++  //
++  
++--- 244,273 ----
++      HashSet serverConnSet;
++  
++  //
++!     public String[]         dbAlias;
++!     public String[]         dbType;
++!     public String[]         dbPath;
++!     public HsqlProperties[] dbProps;
++!     public int[]            dbID;
++  
++  //  Currently unused
++!     public int maxConnections;
++  
++  //
++!     public String            serverId;
++!     public int               serverProtocol;
++!     public ThreadGroup       serverConnectionThreadGroup;
++!     public HsqlSocketFactory socketFactory;
++!     public ServerSocket      socket;
++  
++  //
++!     public Thread           serverThread;
++!     public Throwable        serverError;
++!     public volatile int     serverState;
++!     public volatile boolean isSilent;
++!     public volatile boolean isRemoteOpen;
++!     public PrintWriter      logWriter;
++!     public PrintWriter      errWriter;
++  
++  //
++  
++***************
++*** 275,281 ****
++       * A specialized Thread inner class in which the run() method of this
++       * server executes.
++       */
++!     private class ServerThread extends Thread {
++  
++          /**
++           * Constructs a new thread in which to execute the run method
++--- 275,281 ----
++       * A specialized Thread inner class in which the run() method of this
++       * server executes.
++       */
++!     public class ServerThread extends Thread {
++  
++          /**
++           * Constructs a new thread in which to execute the run method
++***************
++*** 318,324 ****
++       * @param protocol the ServerConstants code indicating which
++       *      connection protocol to handle
++       */
++!     protected Server(int protocol) {
++          init(protocol);
++      }
++  
++--- 318,324 ----
++       * @param protocol the ServerConstants code indicating which
++       *      connection protocol to handle
++       */
++!     public Server(int protocol) {
++          init(protocol);
++      }
++  
++***************
++*** 455,461 ****
++          printWithThread("signalCloseAllServerConnections() exited");
++      }
++  
++!     protected void finalize() throws Throwable {
++  
++          if (serverThread != null) {
++              releaseServerSocket();
++--- 455,461 ----
++          printWithThread("signalCloseAllServerConnections() exited");
++      }
++  
++!     public void finalize() throws Throwable {
++  
++          if (serverThread != null) {
++              releaseServerSocket();
++***************
++*** 1331,1337 ****
++       *
++       * @param socket the socket to test.
++       */
++!     protected boolean allowConnection(Socket socket) {
++          return true;
++      }
++  
++--- 1331,1337 ----
++       *
++       * @param socket the socket to test.
++       */
++!     public boolean allowConnection(Socket socket) {
++          return true;
++      }
++  
++***************
++*** 1340,1346 ****
++       *
++       * @param protocol typically either SC_PROTOCOL_HTTP or SC_PROTOCOL_HSQL
++       */
++!     protected void init(int protocol) {
++  
++          // PRE:  This method is only called from the constructor
++          serverState      = ServerConstants.SERVER_STATE_SHUTDOWN;
++--- 1340,1346 ----
++       *
++       * @param protocol typically either SC_PROTOCOL_HTTP or SC_PROTOCOL_HSQL
++       */
++!     public void init(int protocol) {
++  
++          // PRE:  This method is only called from the constructor
++          serverState      = ServerConstants.SERVER_STATE_SHUTDOWN;
++***************
++*** 1360,1366 ****
++       *
++       * @param state the new value
++       */
++!     protected synchronized void setState(int state) {
++          serverState = state;
++      }
++  
++--- 1360,1366 ----
++       *
++       * @param state the new value
++       */
++!     public synchronized void setState(int state) {
++          serverState = state;
++      }
++  
++***************
++*** 1437,1443 ****
++       *
++       * @param msg The message to print
++       */
++!     protected synchronized void print(String msg) {
++  
++          PrintWriter writer = logWriter;
++  
++--- 1437,1443 ----
++       *
++       * @param msg The message to print
++       */
++!     public synchronized void print(String msg) {
++  
++          PrintWriter writer = logWriter;
++  
++***************
++*** 1482,1488 ****
++       *
++       * @param t the Throwable whose stack trace is to be printed
++       */
++!     protected synchronized void printStackTrace(Throwable t) {
++  
++          if (errWriter != null) {
++              t.printStackTrace(errWriter);
++--- 1482,1488 ----
++       *
++       * @param t the Throwable whose stack trace is to be printed
++       */
++!     public synchronized void printStackTrace(Throwable t) {
++  
++          if (errWriter != null) {
++              t.printStackTrace(errWriter);
++***************
++*** 1508,1514 ****
++       *
++       * @param msg the message to print
++       */
++!     protected void printWithThread(String msg) {
++  
++          if (!isSilent()) {
++              print("[" + Thread.currentThread() + "]: " + msg);
++--- 1508,1514 ----
++       *
++       * @param msg the message to print
++       */
++!     public void printWithThread(String msg) {
++  
++          if (!isSilent()) {
++              print("[" + Thread.currentThread() + "]: " + msg);
++***************
++*** 1522,1528 ****
++       *
++       * @param msg the message to print
++       */
++!     protected synchronized void printError(String msg) {
++  
++          PrintWriter writer = errWriter;
++  
++--- 1522,1528 ----
++       *
++       * @param msg the message to print
++       */
++!     public synchronized void printError(String msg) {
++  
++          PrintWriter writer = errWriter;
++  
++***************
++*** 1880,1886 ****
++      /**
++       * Initialises the database attributes lists from the server properties object.
++       */
++!     private void setDBInfoArrays() {
++  
++          dbAlias = getDBNameArray();
++          dbPath  = new String[dbAlias.length];
++--- 1880,1886 ----
++      /**
++       * Initialises the database attributes lists from the server properties object.
++       */
++!     public void setDBInfoArrays() {
++  
++          dbAlias = getDBNameArray();
++          dbPath  = new String[dbAlias.length];
++***************
++*** 1919,1925 ****
++       * Returns a possibly sparse array of all server.dbname.n values
++       * from the properties object.
++       */
++!     private String[] getDBNameArray() {
++  
++          final String prefix    = ServerConstants.SC_KEY_DBNAME + ".";
++          final int    prefixLen = prefix.length();
++--- 1919,1925 ----
++       * Returns a possibly sparse array of all server.dbname.n values
++       * from the properties object.
++       */
++!     public String[] getDBNameArray() {
++  
++          final String prefix    = ServerConstants.SC_KEY_DBNAME + ".";
++          final int    prefixLen = prefix.length();
++***************
++*** 1960,1966 ****
++       * @throws Exception if it is not possible to construct and install
++       *      a new ServerSocket
++       */
++!     private void openServerSocket() throws Exception {
++  
++          String    address;
++          int       port;
++--- 1960,1966 ----
++       * @throws Exception if it is not possible to construct and install
++       *      a new ServerSocket
++       */
++!     public void openServerSocket() throws Exception {
++  
++          String    address;
++          int       port;
++***************
++*** 2024,2030 ****
++      }
++  
++      /** Prints a timestamped message indicating that this server is online */
++!     private void printServerOnlineMessage() {
++  
++          String s = getProductName() + " " + getProductVersion() + " is online";
++  
++--- 2024,2030 ----
++      }
++  
++      /** Prints a timestamped message indicating that this server is online */
++!     public void printServerOnlineMessage() {
++  
++          String s = getProductName() + " " + getProductVersion() + " is online";
++  
++***************
++*** 2035,2041 ****
++      /**
++       * Prints a description of the server properties iff !isSilent().
++       */
++!     protected void printProperties() {
++  
++          Enumeration e;
++          String      key;
++--- 2035,2041 ----
++      /**
++       * Prints a description of the server properties iff !isSilent().
++       */
++!     public void printProperties() {
++  
++          Enumeration e;
++          String      key;
++***************
++*** 2063,2069 ****
++       * this method exists immediately, otherwise, the result is to fully
++       * shut down the server.
++       */
++!     private void releaseServerSocket() {
++  
++          printWithThread("releaseServerSocket() entered");
++  
++--- 2063,2069 ----
++       * this method exists immediately, otherwise, the result is to fully
++       * shut down the server.
++       */
++!     public void releaseServerSocket() {
++  
++          printWithThread("releaseServerSocket() entered");
++  
++***************
++*** 2092,2098 ****
++       * If any part of the process fails, then this server enters
++       * its shutdown sequence.
++       */
++!     private void run() {
++  
++          StopWatch   sw;
++          ThreadGroup tg;
++--- 2092,2098 ----
++       * If any part of the process fails, then this server enters
++       * its shutdown sequence.
++       */
++!     public void run() {
++  
++          StopWatch   sw;
++          ThreadGroup tg;
++***************
++*** 2176,2182 ****
++       *
++       * @param t The new value for the server error
++       */
++!     protected void setServerError(Throwable t) {
++          serverError = t;
++      }
++  
++--- 2176,2182 ----
++       *
++       * @param t The new value for the server error
++       */
++!     public void setServerError(Throwable t) {
++          serverError = t;
++      }
++  
++***************
++*** 2193,2199 ****
++       * @param error true if shutdown is in response to an error
++       *      state, else false
++       */
++!     protected synchronized void shutdown(boolean error) {
++  
++          if (serverState == ServerConstants.SERVER_STATE_SHUTDOWN) {
++              return;
++--- 2193,2199 ----
++       * @param error true if shutdown is in response to an error
++       *      state, else false
++       */
++!     public synchronized void shutdown(boolean error) {
++  
++          if (serverState == ServerConstants.SERVER_STATE_SHUTDOWN) {
++              return;
++***************
++*** 2276,2282 ****
++       *
++       * @param key for message
++       */
++!     protected static void printHelp(String key) {
++          System.out.print(BundleHandler.getString(serverBundleHandle, key));
++      }
++  }
++--- 2276,2282 ----
++       *
++       * @param key for message
++       */
++!     public static void printHelp(String key) {
++          System.out.print(BundleHandler.getString(serverBundleHandle, key));
++      }
++  }
++diff -crN hsqldb-old/src/org/hsqldb/Servlet.java hsqldb/src/org/hsqldb/Servlet.java
++*** hsqldb-old/src/org/hsqldb/Servlet.java	2007-10-16 08:56:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/Servlet.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 127,139 ****
++   */
++  public class Servlet extends javax.servlet.http.HttpServlet {
++  
++!     private static final int BUFFER_SIZE = 256;
++!     private String           dbType;
++!     private String           dbPath;
++!     private String           errorStr;
++!     private RowOutputBinary  rowOut;
++!     private RowInputBinary   rowIn;
++!     private int              iQueries;
++  
++      /**
++       * Method declaration
++--- 127,139 ----
++   */
++  public class Servlet extends javax.servlet.http.HttpServlet {
++  
++!     public static final int BUFFER_SIZE = 256;
++!     public String           dbType;
++!     public String           dbPath;
++!     public String           errorStr;
++!     public RowOutputBinary  rowOut;
++!     public RowInputBinary   rowIn;
++!     public int              iQueries;
++  
++      /**
++       * Method declaration
++***************
++*** 190,196 ****
++          log("Initialization completed.");
++      }
++  
++!     private static long lModified = 0;
++  
++      /**
++       * Method declaration
++--- 190,196 ----
++          log("Initialization completed.");
++      }
++  
++!     public static long lModified = 0;
++  
++      /**
++       * Method declaration
++***************
++*** 200,206 ****
++       *
++       * @return
++       */
++!     protected long getLastModified(HttpServletRequest req) {
++  
++          // this is made so that the cache of the http server is not used
++          // maybe there is some other way
++--- 200,206 ----
++       *
++       * @return
++       */
++!     public long getLastModified(HttpServletRequest req) {
++  
++          // this is made so that the cache of the http server is not used
++          // maybe there is some other way
++diff -crN hsqldb-old/src/org/hsqldb/Session.java hsqldb/src/org/hsqldb/Session.java
++*** hsqldb-old/src/org/hsqldb/Session.java	2007-06-21 10:17:24.000000000 +0200
++--- hsqldb/src/org/hsqldb/Session.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 113,157 ****
++  public class Session implements SessionInterface {
++  
++      //
++!     private volatile boolean isAutoCommit;
++!     private volatile boolean isReadOnly;
++!     private volatile boolean isClosed;
++  
++      //
++      Database          database;
++!     private User      user;
++      HsqlArrayList     rowActionList;
++!     private boolean   isNestedTransaction;
++!     private int       nestedOldTransIndex;
++      int               isolationMode = SessionInterface.TX_READ_COMMITTED;
++      long              actionTimestamp;
++      long              transactionTimestamp;
++!     private int       currentMaxRows;
++!     private int       sessionMaxRows;
++!     private Number    lastIdentity = ValuePool.getInt(0);
++!     private final int sessionId;
++      HashMappedList    savepoints;
++!     private boolean   script;
++!     private Tokenizer tokenizer;
++!     private Parser    parser;
++      static final Result emptyUpdateCount =
++          new Result(ResultConstants.UPDATECOUNT);
++  
++      //
++!     private jdbcConnection intConnection;
++  
++      // schema
++      public HsqlName  currentSchema;
++      public HsqlName  loggedSchema;
++!     private HsqlName oldSchema;
++  
++      // query processing
++      boolean isProcessingScript;
++      boolean isProcessingLog;
++  
++      // two types of temp tables
++!     private IntKeyHashMap indexArrayMap;
++!     private IntKeyHashMap indexArrayKeepMap;
++  
++      /** @todo fredt - clarify in which circumstances Session has to disconnect */
++      Session getSession() {
++--- 113,157 ----
++  public class Session implements SessionInterface {
++  
++      //
++!     public volatile boolean isAutoCommit;
++!     public volatile boolean isReadOnly;
++!     public volatile boolean isClosed;
++  
++      //
++      Database          database;
++!     public User      user;
++      HsqlArrayList     rowActionList;
++!     public boolean   isNestedTransaction;
++!     public int       nestedOldTransIndex;
++      int               isolationMode = SessionInterface.TX_READ_COMMITTED;
++      long              actionTimestamp;
++      long              transactionTimestamp;
++!     public int       currentMaxRows;
++!     public int       sessionMaxRows;
++!     public Number    lastIdentity = ValuePool.getInt(0);
++!     public final int sessionId;
++      HashMappedList    savepoints;
++!     public boolean   script;
++!     public Tokenizer tokenizer;
++!     public Parser    parser;
++      static final Result emptyUpdateCount =
++          new Result(ResultConstants.UPDATECOUNT);
++  
++      //
++!     public jdbcConnection intConnection;
++  
++      // schema
++      public HsqlName  currentSchema;
++      public HsqlName  loggedSchema;
++!     public HsqlName oldSchema;
++  
++      // query processing
++      boolean isProcessingScript;
++      boolean isProcessingLog;
++  
++      // two types of temp tables
++!     public IntKeyHashMap indexArrayMap;
++!     public IntKeyHashMap indexArrayKeepMap;
++  
++      /** @todo fredt - clarify in which circumstances Session has to disconnect */
++      Session getSession() {
++***************
++*** 728,734 ****
++  
++  // boucherb@users 20020810 metadata 1.7.2
++  //----------------------------------------------------------------
++!     private final long connectTime = System.currentTimeMillis();
++  
++  // more effecient for MetaData concerns than checkAdmin
++  
++--- 728,734 ----
++  
++  // boucherb@users 20020810 metadata 1.7.2
++  //----------------------------------------------------------------
++!     public final long connectTime = System.currentTimeMillis();
++  
++  // more effecient for MetaData concerns than checkAdmin
++  
++***************
++*** 1004,1010 ****
++          }
++      }
++  
++!     private Result performPostExecute(Result r) {
++  
++          try {
++              if (database != null) {
++--- 1004,1010 ----
++          }
++      }
++  
++!     public Result performPostExecute(Result r) {
++  
++          try {
++              if (database != null) {
++***************
++*** 1043,1049 ****
++          return compiledStatementExecutor.execute(cs, pvals);
++      }
++  
++!     private Result sqlExecuteBatch(Result cmd) {
++  
++          int               csid;
++          Record            record;
++--- 1043,1049 ----
++          return compiledStatementExecutor.execute(cs, pvals);
++      }
++  
++!     public Result sqlExecuteBatch(Result cmd) {
++  
++          int               csid;
++          Record            record;
++***************
++*** 1102,1108 ****
++          return out;
++      }
++  
++!     private Result sqlExecuteBatchDirect(Result cmd) {
++  
++          Record record;
++          Result out;
++--- 1102,1108 ----
++          return out;
++      }
++  
++!     public Result sqlExecuteBatchDirect(Result cmd) {
++  
++          Record record;
++          Result out;
++***************
++*** 1163,1169 ****
++       *
++       * @return the result of executing the statement
++       */
++!     private Result sqlExecute(Result cmd) {
++  
++          int csid = cmd.getStatementID();
++          CompiledStatement cs = compiledStatementManager.getStatement(this,
++--- 1163,1169 ----
++       *
++       * @return the result of executing the statement
++       */
++!     public Result sqlExecute(Result cmd) {
++  
++          int csid = cmd.getStatementID();
++          CompiledStatement cs = compiledStatementManager.getStatement(this,
++***************
++*** 1182,1188 ****
++          return sqlExecute(cs, pvals);
++      }
++  
++!     private Result sqlExecute(CompiledStatement cs, Object[] pvals) {
++          return sqlExecuteCompiledNoPreChecks(cs, pvals);
++      }
++  
++--- 1182,1188 ----
++          return sqlExecute(cs, pvals);
++      }
++  
++!     public Result sqlExecute(CompiledStatement cs, Object[] pvals) {
++          return sqlExecuteCompiledNoPreChecks(cs, pvals);
++      }
++  
++diff -crN hsqldb-old/src/org/hsqldb/SessionManager.java hsqldb/src/org/hsqldb/SessionManager.java
++*** hsqldb-old/src/org/hsqldb/SessionManager.java	2007-07-30 07:55:20.000000000 +0200
++--- hsqldb/src/org/hsqldb/SessionManager.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 46,53 ****
++  public class SessionManager {
++  
++      int                   sessionIdCount = 1;
++!     private IntKeyHashMap sessionMap     = new IntKeyHashMap();
++!     private Session       sysSession;
++  
++  // TODO:
++  //
++--- 46,53 ----
++  public class SessionManager {
++  
++      int                   sessionIdCount = 1;
++!     public IntKeyHashMap sessionMap     = new IntKeyHashMap();
++!     public Session       sysSession;
++  
++  // TODO:
++  //
++diff -crN hsqldb-old/src/org/hsqldb/SetFunction.java hsqldb/src/org/hsqldb/SetFunction.java
++*** hsqldb-old/src/org/hsqldb/SetFunction.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/SetFunction.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 51,74 ****
++   */
++  public class SetFunction {
++  
++!     private HashSet distinctValues;
++!     private boolean isDistinct;
++  
++      //
++!     private int setType;
++!     private int type;
++  
++      //
++!     private int count;
++  
++      //
++!     private boolean    hasNull;
++!     private boolean    every = true;
++!     private boolean    some  = false;
++!     private long       currentLong;
++!     private double     currentDouble;
++!     private BigDecimal currentBigDecimal;
++!     private Object     currentValue;
++  
++      SetFunction(int setType, int type, boolean isDistinct) {
++  
++--- 51,74 ----
++   */
++  public class SetFunction {
++  
++!     public HashSet distinctValues;
++!     public boolean isDistinct;
++  
++      //
++!     public int setType;
++!     public int type;
++  
++      //
++!     public int count;
++  
++      //
++!     public boolean    hasNull;
++!     public boolean    every = true;
++!     public boolean    some  = false;
++!     public long       currentLong;
++!     public double     currentDouble;
++!     public BigDecimal currentBigDecimal;
++!     public Object     currentValue;
++  
++      SetFunction(int setType, int type, boolean isDistinct) {
++  
++***************
++*** 423,435 ****
++      // end long sum
++      // statistics support - written by Campbell
++      // this section was orginally an independent class
++!     private double  sk;
++!     private double  vk;
++!     private long    n;
++!     private boolean initialized;
++!     private boolean sample;
++  
++!     private void addDataPoint(Number x) {    // optimized
++  
++          double xi;
++          double xsi;
++--- 423,435 ----
++      // end long sum
++      // statistics support - written by Campbell
++      // this section was orginally an independent class
++!     public double  sk;
++!     public double  vk;
++!     public long    n;
++!     public boolean initialized;
++!     public boolean sample;
++  
++!     public void addDataPoint(Number x) {    // optimized
++  
++          double xi;
++          double xsi;
++***************
++*** 458,464 ****
++          sk  += xi;
++      }
++  
++!     private Number getVariance() {
++  
++          if (!initialized) {
++              return null;
++--- 458,464 ----
++          sk  += xi;
++      }
++  
++!     public Number getVariance() {
++  
++          if (!initialized) {
++              return null;
++***************
++*** 469,475 ****
++                        : new Double(vk / (double) (n));
++      }
++  
++!     private Number getStdDev() {
++  
++          if (!initialized) {
++              return null;
++--- 469,475 ----
++                        : new Double(vk / (double) (n));
++      }
++  
++!     public Number getStdDev() {
++  
++          if (!initialized) {
++              return null;
++diff -crN hsqldb-old/src/org/hsqldb/store/BaseHashMap.java hsqldb/src/org/hsqldb/store/BaseHashMap.java
++*** hsqldb-old/src/org/hsqldb/store/BaseHashMap.java	2006-02-16 04:48:00.000000000 +0100
++--- hsqldb/src/org/hsqldb/store/BaseHashMap.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 88,104 ****
++      boolean isObjectValue;
++  
++      //
++!     protected HashIndex hashIndex;
++  
++      //
++!     protected int[]    intKeyTable;
++!     protected Object[] objectKeyTable;
++!     protected long[]   longKeyTable;
++  
++      //
++!     protected int[]    intValueTable;
++!     protected Object[] objectValueTable;
++!     protected long[]   longValueTable;
++  
++      //
++      int   accessMin;
++--- 88,104 ----
++      boolean isObjectValue;
++  
++      //
++!     public HashIndex hashIndex;
++  
++      //
++!     public int[]    intKeyTable;
++!     public Object[] objectKeyTable;
++!     public long[]   longKeyTable;
++  
++      //
++!     public int[]    intValueTable;
++!     public Object[] objectValueTable;
++!     public long[]   longValueTable;
++  
++      //
++      int   accessMin;
++***************
++*** 110,135 ****
++      final int         initialCapacity;
++      int               threshold;
++      int               maxCapacity;
++!     protected int     purgePolicy = NO_PURGE;
++!     protected boolean minimizeOnEmpty;
++  
++      //
++      boolean hasZeroKey;
++      int     zeroKeyIndex = -1;
++  
++      // keyOrValueTypes
++!     protected static final int noKeyOrValue     = 0;
++!     protected static final int intKeyOrValue    = 1;
++!     protected static final int longKeyOrValue   = 2;
++!     protected static final int objectKeyOrValue = 3;
++  
++      // purgePolicy
++!     protected static final int NO_PURGE      = 0;
++!     protected static final int PURGE_ALL     = 1;
++!     protected static final int PURGE_HALF    = 2;
++!     protected static final int PURGE_QUARTER = 3;
++  
++!     protected BaseHashMap(int initialCapacity, float loadFactor, int keyType,
++                            int valueType,
++                            boolean hasAccessCount)
++                            throws IllegalArgumentException {
++--- 110,135 ----
++      final int         initialCapacity;
++      int               threshold;
++      int               maxCapacity;
++!     public int     purgePolicy = NO_PURGE;
++!     public boolean minimizeOnEmpty;
++  
++      //
++      boolean hasZeroKey;
++      int     zeroKeyIndex = -1;
++  
++      // keyOrValueTypes
++!     public static final int noKeyOrValue     = 0;
++!     public static final int intKeyOrValue    = 1;
++!     public static final int longKeyOrValue   = 2;
++!     public static final int objectKeyOrValue = 3;
++  
++      // purgePolicy
++!     public static final int NO_PURGE      = 0;
++!     public static final int PURGE_ALL     = 1;
++!     public static final int PURGE_HALF    = 2;
++!     public static final int PURGE_QUARTER = 3;
++  
++!     public BaseHashMap(int initialCapacity, float loadFactor, int keyType,
++                            int valueType,
++                            boolean hasAccessCount)
++                            throws IllegalArgumentException {
++***************
++*** 185,191 ****
++          }
++      }
++  
++!     protected int getLookup(Object key, int hash) {
++  
++          int    lookup = hashIndex.getLookup(hash);
++          Object tempKey;
++--- 185,191 ----
++          }
++      }
++  
++!     public int getLookup(Object key, int hash) {
++  
++          int    lookup = hashIndex.getLookup(hash);
++          Object tempKey;
++***************
++*** 201,207 ****
++          return lookup;
++      }
++  
++!     protected int getLookup(int key) {
++  
++          int lookup = hashIndex.getLookup(key);
++          int tempKey;
++--- 201,207 ----
++          return lookup;
++      }
++  
++!     public int getLookup(int key) {
++  
++          int lookup = hashIndex.getLookup(key);
++          int tempKey;
++***************
++*** 217,223 ****
++          return lookup;
++      }
++  
++!     protected int getLookup(long key) {
++  
++          int  lookup = hashIndex.getLookup((int) key);
++          long tempKey;
++--- 217,223 ----
++          return lookup;
++      }
++  
++!     public int getLookup(long key) {
++  
++          int  lookup = hashIndex.getLookup((int) key);
++          long tempKey;
++***************
++*** 236,242 ****
++      /**
++       * generic method for adding or removing keys
++       */
++!     protected Object addOrRemove(long longKey, long longValue,
++                                   Object objectKey, Object objectValue,
++                                   boolean remove) {
++  
++--- 236,242 ----
++      /**
++       * generic method for adding or removing keys
++       */
++!     public Object addOrRemove(long longKey, long longValue,
++                                   Object objectKey, Object objectValue,
++                                   boolean remove) {
++  
++***************
++*** 384,390 ****
++      /**
++       * type-specific method for adding or removing keys in int->Object maps
++       */
++!     protected Object addOrRemove(int intKey, Object objectValue,
++                                   boolean remove) {
++  
++          int    hash        = intKey;
++--- 384,390 ----
++      /**
++       * type-specific method for adding or removing keys in int->Object maps
++       */
++!     public Object addOrRemove(int intKey, Object objectValue,
++                                   boolean remove) {
++  
++          int    hash        = intKey;
++***************
++*** 466,472 ****
++      /**
++       * type specific method for Object sets or Object->Object maps
++       */
++!     protected Object removeObject(Object objectKey) {
++  
++          if (objectKey == null) {
++              return null;
++--- 466,472 ----
++      /**
++       * type specific method for Object sets or Object->Object maps
++       */
++!     public Object removeObject(Object objectKey) {
++  
++          if (objectKey == null) {
++              return null;
++***************
++*** 499,505 ****
++          return returnValue;
++      }
++  
++!     protected boolean reset() {
++  
++          if (maxCapacity == 0 || maxCapacity > threshold) {
++              rehash(hashIndex.hashTable.length * 2);
++--- 499,505 ----
++          return returnValue;
++      }
++  
++!     public boolean reset() {
++  
++          if (maxCapacity == 0 || maxCapacity > threshold) {
++              rehash(hashIndex.hashTable.length * 2);
++***************
++*** 531,537 ****
++       *
++       * newCapacity must be larger or equal to existing number of elements.
++       */
++!     protected void rehash(int newCapacity) {
++  
++          int     limitLookup     = hashIndex.newNodePointer;
++          boolean oldZeroKey      = hasZeroKey;
++--- 531,537 ----
++       *
++       * newCapacity must be larger or equal to existing number of elements.
++       */
++!     public void rehash(int newCapacity) {
++  
++          int     limitLookup     = hashIndex.newNodePointer;
++          boolean oldZeroKey      = hasZeroKey;
++***************
++*** 584,590 ****
++      /**
++       * resize the arrays contianing the key / value data
++       */
++!     private void resizeElementArrays(int dataLength, int newLength) {
++  
++          Object temp;
++          int    usedLength = newLength > dataLength ? dataLength
++--- 584,590 ----
++      /**
++       * resize the arrays contianing the key / value data
++       */
++!     public void resizeElementArrays(int dataLength, int newLength) {
++  
++          Object temp;
++          int    usedLength = newLength > dataLength ? dataLength
++***************
++*** 643,649 ****
++      /**
++       * clear all the key / value data in a range.
++       */
++!     private void clearElementArrays(final int from, final int to) {
++  
++          if (isIntKey) {
++              int counter = to;
++--- 643,649 ----
++      /**
++       * clear all the key / value data in a range.
++       */
++!     public void clearElementArrays(final int from, final int to) {
++  
++          if (isIntKey) {
++              int counter = to;
++***************
++*** 798,804 ****
++       * find the next lookup in the key/value tables with an entry
++       * uses current limits and zero integer key state
++       */
++!     protected int nextLookup(int lookup) {
++  
++          for (++lookup; lookup < hashIndex.newNodePointer; lookup++) {
++              if (isObjectKey) {
++--- 798,804 ----
++       * find the next lookup in the key/value tables with an entry
++       * uses current limits and zero integer key state
++       */
++!     public int nextLookup(int lookup) {
++  
++          for (++lookup; lookup < hashIndex.newNodePointer; lookup++) {
++              if (isObjectKey) {
++***************
++*** 826,837 ****
++      /**
++       * row must already been freed of key / element
++       */
++!     protected void removeRow(int lookup) {
++          hashIndex.removeEmptyNode(lookup);
++          removeFromElementArrays(lookup);
++      }
++  
++!     protected Object removeLookup(int lookup) {
++  
++          if (isObjectKey) {
++              return addOrRemove(0, 0, objectKeyTable[lookup], null, true);
++--- 826,837 ----
++      /**
++       * row must already been freed of key / element
++       */
++!     public void removeRow(int lookup) {
++          hashIndex.removeEmptyNode(lookup);
++          removeFromElementArrays(lookup);
++      }
++  
++!     public Object removeLookup(int lookup) {
++  
++          if (isObjectKey) {
++              return addOrRemove(0, 0, objectKeyTable[lookup], null, true);
++***************
++*** 862,868 ****
++       * Return the max accessCount value for count elements with the lowest
++       * access count. Always return at least accessMin + 1
++       */
++!     protected int getAccessCountCeiling(int count, int margin) {
++          return ArrayCounter.rank(accessTable, hashIndex.newNodePointer,
++                                   count, accessMin + 1, accessCount, margin);
++      }
++--- 862,868 ----
++       * Return the max accessCount value for count elements with the lowest
++       * access count. Always return at least accessMin + 1
++       */
++!     public int getAccessCountCeiling(int count, int margin) {
++          return ArrayCounter.rank(accessTable, hashIndex.newNodePointer,
++                                   count, accessMin + 1, accessCount, margin);
++      }
++***************
++*** 873,879 ****
++       *
++       * Only for maps with Object key table
++       */
++!     protected void clear(int count, int margin) {
++  
++          if (margin < 64) {
++              margin = 64;
++--- 873,879 ----
++       *
++       * Only for maps with Object key table
++       */
++!     public void clear(int count, int margin) {
++  
++          if (margin < 64) {
++              margin = 64;
++***************
++*** 917,923 ****
++          return hashIndex.elementCount == 0;
++      }
++  
++!     protected boolean containsKey(Object key) {
++  
++          if (key == null) {
++              return false;
++--- 917,923 ----
++          return hashIndex.elementCount == 0;
++      }
++  
++!     public boolean containsKey(Object key) {
++  
++          if (key == null) {
++              return false;
++***************
++*** 929,935 ****
++                              : true;
++      }
++  
++!     protected boolean containsKey(int key) {
++  
++          int lookup = getLookup(key);
++  
++--- 929,935 ----
++                              : true;
++      }
++  
++!     public boolean containsKey(int key) {
++  
++          int lookup = getLookup(key);
++  
++***************
++*** 937,943 ****
++                              : true;
++      }
++  
++!     protected boolean containsKey(long key) {
++  
++          int lookup = getLookup(key);
++  
++--- 937,943 ----
++                              : true;
++      }
++  
++!     public boolean containsKey(long key) {
++  
++          int lookup = getLookup(key);
++  
++***************
++*** 945,951 ****
++                              : true;
++      }
++  
++!     protected boolean containsValue(Object value) {
++  
++          int lookup = 0;
++  
++--- 945,951 ----
++                              : true;
++      }
++  
++!     public boolean containsValue(Object value) {
++  
++          int lookup = 0;
++  
++***************
++*** 986,992 ****
++       * Iterator returns Object, int or long and is used both for keys and
++       * values
++       */
++!     protected class BaseHashIterator implements org.hsqldb.lib.Iterator {
++  
++          boolean keys;
++          int     lookup = -1;
++--- 986,992 ----
++       * Iterator returns Object, int or long and is used both for keys and
++       * values
++       */
++!     public class BaseHashIterator implements org.hsqldb.lib.Iterator {
++  
++          boolean keys;
++          int     lookup = -1;
++diff -crN hsqldb-old/src/org/hsqldb/store/BitMap.java hsqldb/src/org/hsqldb/store/BitMap.java
++*** hsqldb-old/src/org/hsqldb/store/BitMap.java	2006-09-22 15:14:04.000000000 +0200
++--- hsqldb/src/org/hsqldb/store/BitMap.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 144,150 ****
++                                   : true;
++      }
++  
++!     private void doubleCapacity() {
++  
++          int[] newmap = new int[map.length * 2];
++  
++--- 144,150 ----
++                                   : true;
++      }
++  
++!     public void doubleCapacity() {
++  
++          int[] newmap = new int[map.length * 2];
++  
++diff -crN hsqldb-old/src/org/hsqldb/store/ValuePoolHashMap.java hsqldb/src/org/hsqldb/store/ValuePoolHashMap.java
++*** hsqldb-old/src/org/hsqldb/store/ValuePoolHashMap.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/store/ValuePoolHashMap.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 98,104 ****
++          this.purgePolicy = newPolicy;
++      }
++  
++!     protected Integer getOrAddInteger(int intKey) {
++  
++          Integer testValue;
++          int     index      = hashIndex.getHashIndex(intKey);
++--- 98,104 ----
++          this.purgePolicy = newPolicy;
++      }
++  
++!     public Integer getOrAddInteger(int intKey) {
++  
++          Integer testValue;
++          int     index      = hashIndex.getHashIndex(intKey);
++***************
++*** 140,146 ****
++          return testValue;
++      }
++  
++!     protected Long getOrAddLong(long longKey) {
++  
++          Long testValue;
++          int index = hashIndex.getHashIndex((int) (longKey
++--- 140,146 ----
++          return testValue;
++      }
++  
++!     public Long getOrAddLong(long longKey) {
++  
++          Long testValue;
++          int index = hashIndex.getHashIndex((int) (longKey
++***************
++*** 199,205 ****
++       * and hashCode().
++       * @return String from map or a new String
++       */
++!     protected String getOrAddString(Object key) {
++  
++          String testValue;
++          int    index      = hashIndex.getHashIndex(key.hashCode());
++--- 199,205 ----
++       * and hashCode().
++       * @return String from map or a new String
++       */
++!     public String getOrAddString(Object key) {
++  
++          String testValue;
++          int    index      = hashIndex.getHashIndex(key.hashCode());
++***************
++*** 241,247 ****
++          return testValue;
++      }
++  
++!     protected Date getOrAddDate(long longKey) {
++  
++          Date testValue;
++          int  hash       = (int) longKey ^ (int) (longKey >>> 32);
++--- 241,247 ----
++          return testValue;
++      }
++  
++!     public Date getOrAddDate(long longKey) {
++  
++          Date testValue;
++          int  hash       = (int) longKey ^ (int) (longKey >>> 32);
++***************
++*** 284,290 ****
++          return testValue;
++      }
++  
++!     protected Double getOrAddDouble(long longKey) {
++  
++          Double testValue;
++          int index = hashIndex.getHashIndex((int) (longKey
++--- 284,290 ----
++          return testValue;
++      }
++  
++!     public Double getOrAddDouble(long longKey) {
++  
++          Double testValue;
++          int index = hashIndex.getHashIndex((int) (longKey
++***************
++*** 327,333 ****
++          return testValue;
++      }
++  
++!     protected Object getOrAddObject(Object key) {
++  
++          Object testValue;
++          int    index      = hashIndex.getHashIndex(key.hashCode());
++--- 327,333 ----
++          return testValue;
++      }
++  
++!     public Object getOrAddObject(Object key) {
++  
++          Object testValue;
++          int    index      = hashIndex.getHashIndex(key.hashCode());
++diff -crN hsqldb-old/src/org/hsqldb/store/ValuePool.java hsqldb/src/org/hsqldb/store/ValuePool.java
++*** hsqldb-old/src/org/hsqldb/store/ValuePool.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/store/ValuePool.java	2007-11-04 00:14:05.000000000 +0100
++***************
++*** 77,83 ****
++          initPool();
++      }
++  
++!     private static void initPool() {
++  
++          int[] sizeArray  = defaultPoolLookupSize;
++          int   sizeFactor = defaultSizeFactor;
++--- 77,83 ----
++          initPool();
++      }
++  
++!     public static void initPool() {
++  
++          int[] sizeArray  = defaultPoolLookupSize;
++          int   sizeFactor = defaultSizeFactor;
++diff -crN hsqldb-old/src/org/hsqldb/TableFilter.java hsqldb/src/org/hsqldb/TableFilter.java
++*** hsqldb-old/src/org/hsqldb/TableFilter.java	2005-11-02 16:20:38.000000000 +0100
++--- hsqldb/src/org/hsqldb/TableFilter.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 94,105 ****
++      static final int   CONDITION_END       = 3;    // candidate for eEnd
++      static final int   CONDITION_OUTER     = 4;    // add to this
++      Table              filterTable;
++!     private String     tableAlias;
++      HashMappedList     columnAliases;
++      Index              filterIndex;
++!     private Object[]   emptyData;
++      boolean[]          usedColumns;
++!     private Expression eStart, eEnd;
++  
++      //
++      Expression eAnd;
++--- 94,105 ----
++      static final int   CONDITION_END       = 3;    // candidate for eEnd
++      static final int   CONDITION_OUTER     = 4;    // add to this
++      Table              filterTable;
++!     public String     tableAlias;
++      HashMappedList     columnAliases;
++      Index              filterIndex;
++!     public Object[]   emptyData;
++      boolean[]          usedColumns;
++!     public Expression eStart, eEnd;
++  
++      //
++      Expression eAnd;
++***************
++*** 111,117 ****
++      Expression[] findFirstExpressions;             // expressions for column values
++  
++      //
++!     private RowIterator it;
++      Object[]            currentData;
++      Row                 currentRow;
++  
++--- 111,117 ----
++      Expression[] findFirstExpressions;             // expressions for column values
++  
++      //
++!     public RowIterator it;
++      Object[]            currentData;
++      Row                 currentRow;
++  
++***************
++*** 329,335 ****
++          }
++      }
++  
++!     private void setCondition(Session session,
++                                Expression e) throws HsqlException {
++  
++          int        type = e.getType();
++--- 329,335 ----
++          }
++      }
++  
++!     public void setCondition(Session session,
++                                Expression e) throws HsqlException {
++  
++          int        type = e.getType();
++***************
++*** 649,655 ****
++       *
++       * @param e the condition to add
++       */
++!     private void addAndCondition(Expression e) {
++  
++          Expression e2 = new Expression(e);
++  
++--- 649,655 ----
++       *
++       * @param e the condition to add
++       */
++!     public void addAndCondition(Expression e) {
++  
++          Expression e2 = new Expression(e);
++  
++diff -crN hsqldb-old/src/org/hsqldb/Table.java hsqldb/src/org/hsqldb/Table.java
++*** hsqldb-old/src/org/hsqldb/Table.java	2007-10-20 22:11:26.000000000 +0200
++--- hsqldb/src/org/hsqldb/Table.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 134,142 ****
++      // main properties
++  // boucherb@users - access changed in support of metadata 1.7.2
++      public HashMappedList columnList;                 // columns in table
++!     private int[]         primaryKeyCols;             // column numbers for primary key
++!     private int[]         primaryKeyTypes;            // types for primary key
++!     private int[]         primaryKeyColsSequence;     // {0,1,2,...}
++      int[]                 bestRowIdentifierCols;      // column set for best index
++      boolean               bestRowIdentifierStrict;    // true if it has no nullable column
++      int[]                 bestIndexForColumn;         // index of the 'best' index for each column
++--- 134,142 ----
++      // main properties
++  // boucherb@users - access changed in support of metadata 1.7.2
++      public HashMappedList columnList;                 // columns in table
++!     public int[]         primaryKeyCols;             // column numbers for primary key
++!     public int[]         primaryKeyTypes;            // types for primary key
++!     public int[]         primaryKeyColsSequence;     // {0,1,2,...}
++      int[]                 bestRowIdentifierCols;      // column set for best index
++      boolean               bestRowIdentifierStrict;    // true if it has no nullable column
++      int[]                 bestIndexForColumn;         // index of the 'best' index for each column
++***************
++*** 148,177 ****
++  // -----------------------------------------------------------------------
++      Constraint[]      constraintList;                 // constrainst for the table
++      HsqlArrayList[]   triggerLists;                   // array of trigger lists
++!     private int[]     colTypes;                       // fredt - types of columns
++!     private int[]     colSizes;                       // fredt - copy of SIZE values for columns
++!     private int[]     colScales;                      // fredt - copy of SCALE values for columns
++!     private boolean[] colNullable;                    // fredt - modified copy of isNullable() values
++!     private Expression[] colDefaults;                 // fredt - expressions of DEFAULT values
++!     private int[]        defaultColumnMap;            // fred - holding 0,1,2,3,...
++!     private boolean      hasDefaultValues;            //fredt - shortcut for above
++      boolean              sqlEnforceSize;              // inherited from the database -
++  
++      // properties for subclasses
++!     protected int           columnCount;              // inclusive the hidden primary key
++      public Database         database;
++!     protected DataFileCache cache;
++!     protected HsqlName      tableName;                // SQL name
++!     private int             tableType;
++!     protected boolean       isReadOnly;
++!     protected boolean       isTemp;
++!     protected boolean       isCached;
++!     protected boolean       isText;
++!     protected boolean       isMemory;
++!     private boolean         isView;
++!     protected boolean       isLogged;
++!     protected int           indexType;                // fredt - type of index used
++!     protected boolean       onCommitPreserve;         // for temp tables
++  
++      //
++      PersistentStore rowStore;
++--- 148,177 ----
++  // -----------------------------------------------------------------------
++      Constraint[]      constraintList;                 // constrainst for the table
++      HsqlArrayList[]   triggerLists;                   // array of trigger lists
++!     public int[]     colTypes;                       // fredt - types of columns
++!     public int[]     colSizes;                       // fredt - copy of SIZE values for columns
++!     public int[]     colScales;                      // fredt - copy of SCALE values for columns
++!     public boolean[] colNullable;                    // fredt - modified copy of isNullable() values
++!     public Expression[] colDefaults;                 // fredt - expressions of DEFAULT values
++!     public int[]        defaultColumnMap;            // fred - holding 0,1,2,3,...
++!     public boolean      hasDefaultValues;            //fredt - shortcut for above
++      boolean              sqlEnforceSize;              // inherited from the database -
++  
++      // properties for subclasses
++!     public int           columnCount;              // inclusive the hidden primary key
++      public Database         database;
++!     public DataFileCache cache;
++!     public HsqlName      tableName;                // SQL name
++!     public int             tableType;
++!     public boolean       isReadOnly;
++!     public boolean       isTemp;
++!     public boolean       isCached;
++!     public boolean       isText;
++!     public boolean       isMemory;
++!     public boolean         isView;
++!     public boolean       isLogged;
++!     public int           indexType;                // fredt - type of index used
++!     public boolean       onCommitPreserve;         // for temp tables
++  
++      //
++      PersistentStore rowStore;
++***************
++*** 325,331 ****
++      /**
++       * sets the isReadOnly flag, and invalidates the database's system tables as needed
++       */
++!     protected void setIsReadOnly(boolean newReadOnly) {
++  
++          isReadOnly = newReadOnly;
++  
++--- 325,331 ----
++      /**
++       * sets the isReadOnly flag, and invalidates the database's system tables as needed
++       */
++!     public void setIsReadOnly(boolean newReadOnly) {
++  
++          isReadOnly = newReadOnly;
++  
++***************
++*** 365,371 ****
++      /**
++       * For text tables
++       */
++!     protected void setDataSource(Session s, String source, boolean isDesc,
++                                   boolean newFile) throws HsqlException {
++          throw (Trace.error(Trace.TABLE_NOT_FOUND));
++      }
++--- 365,371 ----
++      /**
++       * For text tables
++       */
++!     public void setDataSource(Session s, String source, boolean isDesc,
++                                   boolean newFile) throws HsqlException {
++          throw (Trace.error(Trace.TABLE_NOT_FOUND));
++      }
++***************
++*** 373,386 ****
++      /**
++       * For text tables
++       */
++!     protected String getDataSource() {
++          return null;
++      }
++  
++      /**
++       * For text tables.
++       */
++!     protected boolean isDescDataSource() {
++          return false;
++      }
++  
++--- 373,386 ----
++      /**
++       * For text tables
++       */
++!     public String getDataSource() {
++          return null;
++      }
++  
++      /**
++       * For text tables.
++       */
++!     public boolean isDescDataSource() {
++          return false;
++      }
++  
++***************
++*** 675,681 ****
++      /**
++       * returns a basic duplicate of the table without the data structures.
++       */
++!     protected Table duplicate() throws HsqlException {
++  
++          Table t = new Table(database, tableName, tableType);
++  
++--- 675,681 ----
++      /**
++       * returns a basic duplicate of the table without the data structures.
++       */
++!     public Table duplicate() throws HsqlException {
++  
++          Table t = new Table(database, tableName, tableType);
++  
++***************
++*** 816,822 ****
++          return null;
++      }
++  
++!     private void copyIndexes(Table tn, int removeIndex, int colIndex,
++                               int adjust) throws HsqlException {
++  
++          for (int i = 1; i < getIndexCount(); i++) {
++--- 816,822 ----
++          return null;
++      }
++  
++!     public void copyIndexes(Table tn, int removeIndex, int colIndex,
++                               int adjust) throws HsqlException {
++  
++          for (int i = 1; i < getIndexCount(); i++) {
++***************
++*** 887,893 ****
++          }
++      }
++  
++!     private void recompileCheckConstraints(Session session)
++      throws HsqlException {
++  
++          for (int i = 0, size = constraintList.length; i < size; i++) {
++--- 887,893 ----
++          }
++      }
++  
++!     public void recompileCheckConstraints(Session session)
++      throws HsqlException {
++  
++          for (int i = 0, size = constraintList.length; i < size; i++) {
++***************
++*** 902,908 ****
++      /**
++       * Used after adding columns or indexes to the table.
++       */
++!     private void recompileCheckConstraint(Session session,
++                                            Constraint c) throws HsqlException {
++  
++          String     ddl       = c.core.check.getDDL();
++--- 902,908 ----
++      /**
++       * Used after adding columns or indexes to the table.
++       */
++!     public void recompileCheckConstraint(Session session,
++                                            Constraint c) throws HsqlException {
++  
++          String     ddl       = c.core.check.getDDL();
++***************
++*** 984,990 ****
++      /**
++       * Used for rename column.
++       */
++!     private void renameColumnInCheckConstraints(String oldname,
++              String newname, boolean isquoted) throws HsqlException {
++  
++          for (int i = 0, size = constraintList.length; i < size; i++) {
++--- 984,990 ----
++      /**
++       * Used for rename column.
++       */
++!     public void renameColumnInCheckConstraints(String oldname,
++              String newname, boolean isquoted) throws HsqlException {
++  
++          for (int i = 0, size = constraintList.length; i < size; i++) {
++***************
++*** 1011,1017 ****
++      /**
++       * Used for drop column.
++       */
++!     private void renameTableInCheckConstraints(Session session,
++              String oldname, String newname) throws HsqlException {
++  
++          for (int i = 0, size = constraintList.length; i < size; i++) {
++--- 1011,1017 ----
++      /**
++       * Used for drop column.
++       */
++!     public void renameTableInCheckConstraints(Session session,
++              String oldname, String newname) throws HsqlException {
++  
++          for (int i = 0, size = constraintList.length; i < size; i++) {
++***************
++*** 1517,1523 ****
++       *  Create new index taking into account removal or addition of a column
++       *  to the table.
++       */
++!     private Index createAdjustedIndex(Index index, int colindex,
++                                        int adjust) throws HsqlException {
++  
++          int[] indexcolumns = (int[]) ArrayUtil.resizeArray(index.getColumns(),
++--- 1517,1523 ----
++       *  Create new index taking into account removal or addition of a column
++       *  to the table.
++       */
++!     public Index createAdjustedIndex(Index index, int colindex,
++                                        int adjust) throws HsqlException {
++  
++          int[] indexcolumns = (int[]) ArrayUtil.resizeArray(index.getColumns(),
++***************
++*** 1637,1643 ****
++          return indexNo;
++      }
++  
++!     private int addIndex(Index index) {
++  
++          int i = 0;
++  
++--- 1637,1643 ----
++          return indexNo;
++      }
++  
++!     public int addIndex(Index index) {
++  
++          int i = 0;
++  
++***************
++*** 1883,1889 ****
++       *  Mid level method for inserting rows. Performs constraint checks and
++       *  fires row level triggers.
++       */
++!     private void insertRow(Session session,
++                             Object[] data) throws HsqlException {
++  
++          if (triggerLists[Trigger.INSERT_BEFORE_ROW] != null) {
++--- 1883,1889 ----
++       *  Mid level method for inserting rows. Performs constraint checks and
++       *  fires row level triggers.
++       */
++!     public void insertRow(Session session,
++                             Object[] data) throws HsqlException {
++  
++          if (triggerLists[Trigger.INSERT_BEFORE_ROW] != null) {
++***************
++*** 1929,1935 ****
++       *  UNIQUE or PRIMARY constraints are enforced by attempting to
++       *  add the row to the indexes.
++       */
++!     private void insertNoCheck(Session session,
++                                 Object[] data) throws HsqlException {
++  
++          Row row = newRow(data);
++--- 1929,1935 ----
++       *  UNIQUE or PRIMARY constraints are enforced by attempting to
++       *  add the row to the indexes.
++       */
++!     public void insertNoCheck(Session session,
++                                 Object[] data) throws HsqlException {
++  
++          Row row = newRow(data);
++***************
++*** 2059,2065 ****
++       * Used by TextCache to insert a row into the indexes when the source
++       * file is first read.
++       */
++!     protected void insertFromTextSource(CachedRow row) throws HsqlException {
++  
++          Object[] data = row.getData();
++  
++--- 2059,2065 ----
++       * Used by TextCache to insert a row into the indexes when the source
++       * file is first read.
++       */
++!     public void insertFromTextSource(CachedRow row) throws HsqlException {
++  
++          Object[] data = row.getData();
++  
++***************
++*** 2072,2078 ****
++      /**
++       * Checks a row against NOT NULL constraints on columns.
++       */
++!     protected void enforceNullConstraints(Object[] data) throws HsqlException {
++  
++          for (int i = 0; i < columnCount; i++) {
++              if (data[i] == null && !colNullable[i]) {
++--- 2072,2078 ----
++      /**
++       * Checks a row against NOT NULL constraints on columns.
++       */
++!     public void enforceNullConstraints(Object[] data) throws HsqlException {
++  
++          for (int i = 0; i < columnCount; i++) {
++              if (data[i] == null && !colNullable[i]) {
++***************
++*** 2087,2093 ****
++       * If there is an identity column (visible or hidden) on the table, sets
++       * the value and/or adjusts the iIdentiy value for the table.
++       */
++!     protected void setIdentityColumn(Session session,
++                                       Object[] data) throws HsqlException {
++  
++          if (identityColumn != -1) {
++--- 2087,2093 ----
++       * If there is an identity column (visible or hidden) on the table, sets
++       * the value and/or adjusts the iIdentiy value for the table.
++       */
++!     public void setIdentityColumn(Session session,
++                                       Object[] data) throws HsqlException {
++  
++          if (identityColumn != -1) {
++***************
++*** 2115,2121 ****
++       * If there is an identity column (visible or hidden) on the table, sets
++       * the max identity value.
++       */
++!     protected void updateIdentityValue(Object[] data) throws HsqlException {
++  
++          if (identityColumn != -1) {
++              Number id = (Number) data[identityColumn];
++--- 2115,2121 ----
++       * If there is an identity column (visible or hidden) on the table, sets
++       * the max identity value.
++       */
++!     public void updateIdentityValue(Object[] data) throws HsqlException {
++  
++          if (identityColumn != -1) {
++              Number id = (Number) data[identityColumn];
++***************
++*** 2786,2792 ****
++       *  Mid level row delete method. Fires triggers but no integrity
++       *  constraint checks.
++       */
++!     private void deleteNoRefCheck(Session session,
++                                    Row row) throws HsqlException {
++  
++          Object[] data = row.getData();
++--- 2786,2792 ----
++       *  Mid level row delete method. Fires triggers but no integrity
++       *  constraint checks.
++       */
++!     public void deleteNoRefCheck(Session session,
++                                    Row row) throws HsqlException {
++  
++          Object[] data = row.getData();
++***************
++*** 2802,2808 ****
++       * Low level row delete method. Removes the row from the indexes and
++       * from the Cache.
++       */
++!     private void deleteNoCheck(Session session, Row row,
++                                 boolean log) throws HsqlException {
++  
++          if (row.isCascadeDeleted()) {
++--- 2802,2808 ----
++       * Low level row delete method. Removes the row from the indexes and
++       * from the Cache.
++       */
++!     public void deleteNoCheck(Session session, Row row,
++                                 boolean log) throws HsqlException {
++  
++          if (row.isCascadeDeleted()) {
++diff -crN hsqldb-old/src/org/hsqldb/TableWorks.java hsqldb/src/org/hsqldb/TableWorks.java
++*** hsqldb-old/src/org/hsqldb/TableWorks.java	2007-07-09 10:49:26.000000000 +0200
++--- hsqldb/src/org/hsqldb/TableWorks.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 46,53 ****
++   */
++  class TableWorks {
++  
++!     private Table   table;
++!     private Session session;
++  
++      TableWorks(Session session, Table table) {
++          this.table   = table;
++--- 46,53 ----
++   */
++  class TableWorks {
++  
++!     public Table   table;
++!     public Session session;
++  
++      TableWorks(Session session, Table table) {
++          this.table   = table;
++diff -crN hsqldb-old/src/org/hsqldb/test/TestAllTypes.java hsqldb/src/org/hsqldb/test/TestAllTypes.java
++*** hsqldb-old/src/org/hsqldb/test/TestAllTypes.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestAllTypes.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 48,59 ****
++   */
++  public class TestAllTypes {
++  
++!     protected String url = "jdbc:hsqldb:";
++  
++! //    protected String filepath = ".";
++!     protected String filepath = "/hsql/testalltypes/test";
++  
++! //    protected String filepath = "hsql://localhost/yourtest";
++      boolean    network = true;
++      String     user;
++      String     password;
++--- 48,59 ----
++   */
++  public class TestAllTypes {
++  
++!     public String url = "jdbc:hsqldb:";
++  
++! //    public String filepath = ".";
++!     public String filepath = "/hsql/testalltypes/test";
++  
++! //    public String filepath = "hsql://localhost/yourtest";
++      boolean    network = true;
++      String     user;
++      String     password;
++***************
++*** 79,85 ****
++      //
++      int bigrows = 1000;
++  
++!     protected void setUp() {
++  
++          user     = "sa";
++          password = "";
++--- 79,85 ----
++      //
++      int bigrows = 1000;
++  
++!     public void setUp() {
++  
++          user     = "sa";
++          password = "";
++***************
++*** 266,274 ****
++          }
++      }
++  
++!     protected void tearDown() {}
++  
++!     protected void checkResults() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++--- 266,274 ----
++          }
++      }
++  
++!     public void tearDown() {}
++  
++!     public void checkResults() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++***************
++*** 313,319 ****
++          }
++      }
++  
++!     private void checkSelects() {
++  
++          StopWatch        sw        = new StopWatch();
++          int              smallrows = 0xfff;
++--- 313,319 ----
++          }
++      }
++  
++!     public void checkSelects() {
++  
++          StopWatch        sw        = new StopWatch();
++          int              smallrows = 0xfff;
++***************
++*** 368,374 ****
++                             + (i * 1000 / sw.elapsedTime()));
++      }
++  
++!     private void checkUpdates() {
++  
++          StopWatch        sw        = new StopWatch();
++          int              smallrows = 0xfff;
++--- 368,374 ----
++                             + (i * 1000 / sw.elapsedTime()));
++      }
++  
++!     public void checkUpdates() {
++  
++          StopWatch        sw        = new StopWatch();
++          int              smallrows = 0xfff;
++diff -crN hsqldb-old/src/org/hsqldb/test/TestBase.java hsqldb/src/org/hsqldb/test/TestBase.java
++*** hsqldb-old/src/org/hsqldb/test/TestBase.java	2007-06-21 10:33:58.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestBase.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 70,76 ****
++          this.url       = connectionUrl;
++      }
++  
++!     protected void setUp() {
++  
++          if (isNetwork) {
++              if (url == null) {
++--- 70,76 ----
++          this.url       = connectionUrl;
++      }
++  
++!     public void setUp() {
++  
++          if (isNetwork) {
++              if (url == null) {
++***************
++*** 98,104 ****
++          }
++      }
++  
++!     protected void tearDown() {
++  
++          if (isNetwork) {
++              server.stop();
++--- 98,104 ----
++          }
++      }
++  
++!     public void tearDown() {
++  
++          if (isNetwork) {
++              server.stop();
++diff -crN hsqldb-old/src/org/hsqldb/test/TestBugBase.java hsqldb/src/org/hsqldb/test/TestBugBase.java
++*** hsqldb-old/src/org/hsqldb/test/TestBugBase.java	2005-06-08 21:52:36.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestBugBase.java	2007-11-04 00:13:48.000000000 +0100
++***************
++*** 59,65 ****
++          super(name);
++      }
++  
++!     protected void setUp() {
++  
++          server = new Server();
++  
++--- 59,65 ----
++          super(name);
++      }
++  
++!     public void setUp() {
++  
++          server = new Server();
++  
++***************
++*** 76,82 ****
++          }
++      }
++  
++!     protected void tearDown() {
++  
++          server.stop();
++  
++--- 76,82 ----
++          }
++      }
++  
++!     public void tearDown() {
++  
++          server.stop();
++  
++diff -crN hsqldb-old/src/org/hsqldb/test/TestCacheSize.java hsqldb/src/org/hsqldb/test/TestCacheSize.java
++*** hsqldb-old/src/org/hsqldb/test/TestCacheSize.java	2007-10-11 11:32:18.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestCacheSize.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 70,86 ****
++  public class TestCacheSize {
++  
++      // program can edit the *.properties file to set cache_size, old files are deleted
++!     protected boolean filedb = true;
++  
++      // shutdown performed mid operation - not for mem: or hsql: URL's
++!     protected boolean shutdown = true;
++  
++      // fixed
++!     protected String url = "jdbc:hsqldb:";
++  
++! //    protected String  filepath = "hsql://localhost/mytest";
++! //    protected String filepath = "mem:test";
++!     protected String filepath = "/hsql/testcache/test";
++  
++      // frequent reporting of progress
++      boolean reportProgress = false;
++--- 70,86 ----
++  public class TestCacheSize {
++  
++      // program can edit the *.properties file to set cache_size, old files are deleted
++!     public boolean filedb = true;
++  
++      // shutdown performed mid operation - not for mem: or hsql: URL's
++!     public boolean shutdown = true;
++  
++      // fixed
++!     public String url = "jdbc:hsqldb:";
++  
++! //    public String  filepath = "hsql://localhost/mytest";
++! //    public String filepath = "mem:test";
++!     public String filepath = "/hsql/testcache/test";
++  
++      // frequent reporting of progress
++      boolean reportProgress = false;
++***************
++*** 124,130 ****
++      Connection cConnection;
++      FileWriter writer;
++  
++!     private void checkSelects() {
++  
++          countTestID();
++  
++--- 124,130 ----
++      Connection cConnection;
++      FileWriter writer;
++  
++!     public void checkSelects() {
++  
++          countTestID();
++  
++***************
++*** 132,138 ****
++          selectZipTable();
++      }
++  
++!     private void checkUpdates() {
++  
++          updateIDLinear();
++  
++--- 132,138 ----
++          selectZipTable();
++      }
++  
++!     public void checkUpdates() {
++  
++          updateIDLinear();
++  
++***************
++*** 143,149 ****
++          countZip();
++      }
++  
++!     protected void setUp() {
++  
++          try {
++              writer = new FileWriter("speedtests.html", true);
++--- 143,149 ----
++          countZip();
++      }
++  
++!     public void setUp() {
++  
++          try {
++              writer = new FileWriter("speedtests.html", true);
++***************
++*** 316,322 ****
++          }
++      }
++  
++!     private void fillUpBigTable(String filler,
++                                  Random randomgen) throws SQLException {
++  
++          StopWatch sw = new StopWatch();
++--- 316,322 ----
++          }
++      }
++  
++!     public void fillUpBigTable(String filler,
++                                  Random randomgen) throws SQLException {
++  
++          StopWatch sw = new StopWatch();
++***************
++*** 418,424 ****
++                             + " ms -- " + rate + " tps");
++      }
++  
++!     private void fillUpMultiTable(String filler,
++                                    Random randomgen) throws SQLException {
++  
++          StopWatch sw = new StopWatch();
++--- 418,424 ----
++                             + " ms -- " + rate + " tps");
++      }
++  
++!     public void fillUpMultiTable(String filler,
++                                    Random randomgen) throws SQLException {
++  
++          StopWatch sw = new StopWatch();
++***************
++*** 471,477 ****
++                             + (i * 1000 / (sw.elapsedTime() + 1)));
++      }
++  
++!     protected void tearDown() {
++  
++          try {
++              writer.write("\n</table>\n");
++--- 471,477 ----
++                             + (i * 1000 / (sw.elapsedTime() + 1)));
++      }
++  
++!     public void tearDown() {
++  
++          try {
++              writer.write("\n</table>\n");
++***************
++*** 479,485 ****
++          } catch (Exception e) {}
++      }
++  
++!     protected void checkResults() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++--- 479,485 ----
++          } catch (Exception e) {}
++      }
++  
++!     public void checkResults() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++***************
++*** 626,632 ****
++                             + " rows  -- " + time + " ms -- " + rate + " tps");
++      }
++  
++!     private void countTestID() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++--- 626,632 ----
++                             + " rows  -- " + time + " ms -- " + rate + " tps");
++      }
++  
++!     public void countTestID() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++***************
++*** 649,655 ****
++          } catch (SQLException e) {}
++      }
++  
++!     private void countTestZip() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++--- 649,655 ----
++          } catch (SQLException e) {}
++      }
++  
++!     public void countTestZip() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++***************
++*** 670,676 ****
++          } catch (SQLException e) {}
++      }
++  
++!     private void countZip() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++--- 670,676 ----
++          } catch (SQLException e) {}
++      }
++  
++!     public void countZip() {
++  
++          try {
++              StopWatch sw = new StopWatch();
++***************
++*** 685,691 ****
++          } catch (SQLException e) {}
++      }
++  
++!     private void updateZip() {
++  
++          StopWatch        sw        = new StopWatch();
++          java.util.Random randomgen = new java.util.Random();
++--- 685,691 ----
++          } catch (SQLException e) {}
++      }
++  
++!     public void updateZip() {
++  
++          StopWatch        sw        = new StopWatch();
++          java.util.Random randomgen = new java.util.Random();
++diff -crN hsqldb-old/src/org/hsqldb/test/TestCascade.java hsqldb/src/org/hsqldb/test/TestCascade.java
++*** hsqldb-old/src/org/hsqldb/test/TestCascade.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestCascade.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 59,65 ****
++          super(name);
++      }
++  
++!     protected void setUp() {
++  
++          try {
++              Class.forName("org.hsqldb.jdbcDriver");
++--- 59,65 ----
++          super(name);
++      }
++  
++!     public void setUp() {
++  
++          try {
++              Class.forName("org.hsqldb.jdbcDriver");
++***************
++*** 72,78 ****
++          }
++      }
++  
++!     protected void tearDown() {
++  
++          try {
++              con.close();
++--- 72,78 ----
++          }
++      }
++  
++!     public void tearDown() {
++  
++          try {
++              con.close();
++***************
++*** 109,115 ****
++          }
++      }
++  
++!     private static void createDatabase() throws SQLException {
++  
++          new File("testdb.backup").delete();
++          new File("testdb.data").delete();
++--- 109,115 ----
++          }
++      }
++  
++!     public static void createDatabase() throws SQLException {
++  
++          new File("testdb.backup").delete();
++          new File("testdb.data").delete();
++***************
++*** 141,147 ****
++       * the CA table has 12 records. After, it should have 9, but instead it has
++       * 0.
++       */
++!     private static void deleteXBRecord(Connection con) throws SQLException {
++  
++          Statement stmt = con.createStatement();
++  
++--- 141,147 ----
++       * the CA table has 12 records. After, it should have 9, but instead it has
++       * 0.
++       */
++!     public static void deleteXBRecord(Connection con) throws SQLException {
++  
++          Statement stmt = con.createStatement();
++  
++***************
++*** 150,156 ****
++          stmt.close();
++      }    // deleteXBRecord
++  
++!     private static void insertData(Connection con) throws SQLException {
++  
++          String[] saData = {
++              "INSERT INTO XB VALUES('T850','LEAA','00','P',NULL,'LCN NAME','sa',NOW)",
++--- 150,156 ----
++          stmt.close();
++      }    // deleteXBRecord
++  
++!     public static void insertData(Connection con) throws SQLException {
++  
++          String[] saData = {
++              "INSERT INTO XB VALUES('T850','LEAA','00','P',NULL,'LCN NAME','sa',NOW)",
++diff -crN hsqldb-old/src/org/hsqldb/test/TestCollation.java hsqldb/src/org/hsqldb/test/TestCollation.java
++*** hsqldb-old/src/org/hsqldb/test/TestCollation.java	2007-06-21 10:34:40.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestCollation.java	2007-11-04 00:13:48.000000000 +0100
++***************
++*** 51,57 ****
++          super.isNetwork = false;
++      }
++  
++!     protected void setUp() {
++  
++          super.setUp();
++  
++--- 51,57 ----
++          super.isNetwork = false;
++      }
++  
++!     public void setUp() {
++  
++          super.setUp();
++  
++***************
++*** 65,71 ****
++          localeIterator = collation.getLocalesIterator();
++      }
++  
++!     protected void tearDown() {
++  
++          try {
++              statement = connection.createStatement();
++--- 65,71 ----
++          localeIterator = collation.getLocalesIterator();
++      }
++  
++!     public void tearDown() {
++  
++          try {
++              statement = connection.createStatement();
++***************
++*** 188,194 ****
++      /**
++       * returns an SQL statement to set the database collation
++       */
++!     protected final String getSetCollationStmt(String collationName) {
++  
++          final String setCollationStmtPre  = "SET DATABASE COLLATION \"";
++          final String setCollationStmtPost = "\"";
++--- 188,194 ----
++      /**
++       * returns an SQL statement to set the database collation
++       */
++!     public final String getSetCollationStmt(String collationName) {
++  
++          final String setCollationStmtPre  = "SET DATABASE COLLATION \"";
++          final String setCollationStmtPost = "\"";
++***************
++*** 199,205 ****
++      /**
++       * checks sorting a table with according to a given collation
++       */
++!     protected String checkSorting(String collationName) {
++  
++          String prepareStmt =
++              "DROP TABLE WORDLIST IF EXISTS;"
++--- 199,205 ----
++      /**
++       * checks sorting a table with according to a given collation
++       */
++!     public String checkSorting(String collationName) {
++  
++          String prepareStmt =
++              "DROP TABLE WORDLIST IF EXISTS;"
++diff -crN hsqldb-old/src/org/hsqldb/test/TestDataStructures.java hsqldb/src/org/hsqldb/test/TestDataStructures.java
++*** hsqldb-old/src/org/hsqldb/test/TestDataStructures.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestDataStructures.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 51,69 ****
++   */
++  public class TestDataStructures extends TestCase {
++  
++!     private static final int NUMBER_OF_TEST_RUNS          = 100000;
++!     private static final int NUMBER_OF_ITERATIONS_PER_RUN = 80;
++!     private Random           randomGenerator;
++  
++      //Commands
++!     private static final int ADD        = 1;
++!     private static final int ADD_AT     = 2;
++!     private static final int GET        = 3;
++!     private static final int REMOVE     = 4;
++!     private static final int SET        = 5;
++!     private static final int OPTIMIZE   = 6;
++!     private static final int REMOVE_ALL = 7;
++!     private Vector           listCommandsCalled;
++  
++      /** Creates a new instance of TestDataStructures */
++      public TestDataStructures(String s) {
++--- 51,69 ----
++   */
++  public class TestDataStructures extends TestCase {
++  
++!     public static final int NUMBER_OF_TEST_RUNS          = 100000;
++!     public static final int NUMBER_OF_ITERATIONS_PER_RUN = 80;
++!     public Random           randomGenerator;
++  
++      //Commands
++!     public static final int ADD        = 1;
++!     public static final int ADD_AT     = 2;
++!     public static final int GET        = 3;
++!     public static final int REMOVE     = 4;
++!     public static final int SET        = 5;
++!     public static final int OPTIMIZE   = 6;
++!     public static final int REMOVE_ALL = 7;
++!     public Vector           listCommandsCalled;
++  
++      /** Creates a new instance of TestDataStructures */
++      public TestDataStructures(String s) {
++***************
++*** 323,329 ****
++      }
++  
++      /** Returns whether three objects are equal */
++!     private boolean objectEquals(Object lObject, Object aObject,
++                                   Object vObject) {
++  
++          if (lObject == null && aObject == null && vObject == null) {
++--- 323,329 ----
++      }
++  
++      /** Returns whether three objects are equal */
++!     public boolean objectEquals(Object lObject, Object aObject,
++                                   Object vObject) {
++  
++          if (lObject == null && aObject == null && vObject == null) {
++***************
++*** 348,354 ****
++      }
++  
++      /** Returns a random integer in the range of the lowBound and highBound */
++!     private int getRandomInt(int lowBound, int highBound) {
++  
++          double random = randomGenerator.nextDouble();
++  
++--- 348,354 ----
++      }
++  
++      /** Returns a random integer in the range of the lowBound and highBound */
++!     public int getRandomInt(int lowBound, int highBound) {
++  
++          double random = randomGenerator.nextDouble();
++  
++***************
++*** 359,371 ****
++       * Returns an Integer object with a value between Integer.MIN_VALUE and
++       * Integer.MAX_VALUE
++       */
++!     private Integer getRandomInteger() {
++          return new Integer(getRandomInt(0, (int) (Integer.MAX_VALUE
++                  / 100.0)));
++      }
++  
++      /** Tells whether the given list contains the same data as the vector */
++!     private boolean equalsVector(HsqlList list, Vector vector) {
++  
++          if (list.size() != vector.size()) {
++              return false;
++--- 359,371 ----
++       * Returns an Integer object with a value between Integer.MIN_VALUE and
++       * Integer.MAX_VALUE
++       */
++!     public Integer getRandomInteger() {
++          return new Integer(getRandomInt(0, (int) (Integer.MAX_VALUE
++                  / 100.0)));
++      }
++  
++      /** Tells whether the given list contains the same data as the vector */
++!     public boolean equalsVector(HsqlList list, Vector vector) {
++  
++          if (list.size() != vector.size()) {
++              return false;
++diff -crN hsqldb-old/src/org/hsqldb/test/TestDateTime.java hsqldb/src/org/hsqldb/test/TestDateTime.java
++*** hsqldb-old/src/org/hsqldb/test/TestDateTime.java	2007-01-09 10:15:28.000000000 +0100
++--- hsqldb/src/org/hsqldb/test/TestDateTime.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 51,57 ****
++          super(s);
++      }
++  
++!     protected void setUp() {
++  
++          super.setUp();
++  
++--- 51,57 ----
++          super(s);
++      }
++  
++!     public void setUp() {
++  
++          super.setUp();
++  
++diff -crN hsqldb-old/src/org/hsqldb/test/TestGroupByHaving.java hsqldb/src/org/hsqldb/test/TestGroupByHaving.java
++*** hsqldb-old/src/org/hsqldb/test/TestGroupByHaving.java	2007-10-16 08:56:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestGroupByHaving.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 54,69 ****
++      //------------------------------------------------------------
++      // Class variables
++      //------------------------------------------------------------
++!     private static final String databaseDriver   = "org.hsqldb.jdbcDriver";
++!     private static final String databaseURL      = "jdbc:hsqldb:mem:.";
++!     private static final String databaseUser     = "sa";
++!     private static final String databasePassword = "";
++  
++      //------------------------------------------------------------
++      // Instance variables
++      //------------------------------------------------------------
++!     private Connection conn;
++!     private Statement  stmt;
++  
++      //------------------------------------------------------------
++      // Constructors
++--- 54,69 ----
++      //------------------------------------------------------------
++      // Class variables
++      //------------------------------------------------------------
++!     public static final String databaseDriver   = "org.hsqldb.jdbcDriver";
++!     public static final String databaseURL      = "jdbc:hsqldb:mem:.";
++!     public static final String databaseUser     = "sa";
++!     public static final String databasePassword = "";
++  
++      //------------------------------------------------------------
++      // Instance variables
++      //------------------------------------------------------------
++!     public Connection conn;
++!     public Statement  stmt;
++  
++      //------------------------------------------------------------
++      // Constructors
++***************
++*** 79,90 ****
++      //------------------------------------------------------------
++      // Class methods
++      //------------------------------------------------------------
++!     protected static Connection getJDBCConnection() throws SQLException {
++          return DriverManager.getConnection(databaseURL, databaseUser,
++                                             databasePassword);
++      }
++  
++!     protected void setUp() throws Exception {
++  
++          super.setUp();
++  
++--- 79,90 ----
++      //------------------------------------------------------------
++      // Class methods
++      //------------------------------------------------------------
++!     public static Connection getJDBCConnection() throws SQLException {
++          return DriverManager.getConnection(databaseURL, databaseUser,
++                                             databasePassword);
++      }
++  
++!     public void setUp() throws Exception {
++  
++          super.setUp();
++  
++***************
++*** 127,133 ****
++          addEmployee(23, "Barbara", "Hood", 30000, 2);
++      }
++  
++!     protected void tearDown() throws Exception {
++  
++  
++          // I decided not the use the "IF EXISTS" clause since it is not a
++--- 127,133 ----
++          addEmployee(23, "Barbara", "Hood", 30000, 2);
++      }
++  
++!     public void tearDown() throws Exception {
++  
++  
++          // I decided not the use the "IF EXISTS" clause since it is not a
++***************
++*** 152,158 ****
++          super.tearDown();
++      }
++  
++!     private void addEmployee(int id, String firstName, String lastName,
++                               double salary, int superiorId) throws Exception {
++  
++          stmt.execute("insert into employee values(" + id + ", '" + firstName
++--- 152,158 ----
++          super.tearDown();
++      }
++  
++!     public void addEmployee(int id, String firstName, String lastName,
++                               double salary, int superiorId) throws Exception {
++  
++          stmt.execute("insert into employee values(" + id + ", '" + firstName
++***************
++*** 294,300 ****
++      //------------------------------------------------------------
++      // Helper methods
++      //------------------------------------------------------------
++!     private void compareResults(String sql, Object[][] rows,
++                                  int errorCode) throws SQLException {
++  
++          ResultSet rs = null;
++--- 294,300 ----
++      //------------------------------------------------------------
++      // Helper methods
++      //------------------------------------------------------------
++!     public void compareResults(String sql, Object[][] rows,
++                                  int errorCode) throws SQLException {
++  
++          ResultSet rs = null;
++diff -crN hsqldb-old/src/org/hsqldb/test/TestJDBCSavepoints.java hsqldb/src/org/hsqldb/test/TestJDBCSavepoints.java
++*** hsqldb-old/src/org/hsqldb/test/TestJDBCSavepoints.java	2007-10-16 08:56:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestJDBCSavepoints.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 75,81 ****
++          super(name);
++      }
++  
++!     protected void setUp() {
++  
++          user     = "sa";
++          password = "";
++--- 75,81 ----
++          super(name);
++      }
++  
++!     public void setUp() {
++  
++          user     = "sa";
++          password = "";
++***************
++*** 103,109 ****
++          }
++      }
++  
++!     protected void tearDown() {
++  
++          try {
++              conn1.close();
++--- 103,109 ----
++          }
++      }
++  
++!     public void tearDown() {
++  
++          try {
++              conn1.close();
++diff -crN hsqldb-old/src/org/hsqldb/test/TestMultipleConnections.java hsqldb/src/org/hsqldb/test/TestMultipleConnections.java
++*** hsqldb-old/src/org/hsqldb/test/TestMultipleConnections.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestMultipleConnections.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 85,91 ****
++      /**
++       * create a connection and wait
++       */
++!     protected Connection createObject() {
++  
++          try {
++              Class.forName("org.hsqldb.jdbcDriver");
++--- 85,91 ----
++      /**
++       * create a connection and wait
++       */
++!     public Connection createObject() {
++  
++          try {
++              Class.forName("org.hsqldb.jdbcDriver");
++diff -crN hsqldb-old/src/org/hsqldb/test/TestPreparedSubQueries.java hsqldb/src/org/hsqldb/test/TestPreparedSubQueries.java
++*** hsqldb-old/src/org/hsqldb/test/TestPreparedSubQueries.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestPreparedSubQueries.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 40,48 ****
++   */
++  class TestPreparedSubQueries {
++  
++!     private Connection con = null;
++  
++!     private class sqlStmt {
++  
++          boolean prepare;
++          boolean update;
++--- 40,48 ----
++   */
++  class TestPreparedSubQueries {
++  
++!     public Connection con = null;
++  
++!     public class sqlStmt {
++  
++          boolean prepare;
++          boolean update;
++***************
++*** 57,63 ****
++      }
++      ;
++  
++!     private sqlStmt[] stmtArray = {
++          new sqlStmt("drop table a if exists", false, false),
++          new sqlStmt("create cached table a (a int identity,b int)", false,
++                      false),
++--- 57,63 ----
++      }
++      ;
++  
++!     public sqlStmt[] stmtArray = {
++          new sqlStmt("drop table a if exists", false, false),
++          new sqlStmt("create cached table a (a int identity,b int)", false,
++                      false),
++***************
++*** 77,83 ****
++              "update a set b=300 where b>(select b from a X where X.a=?)",
++              true, true)
++      };
++!     private Object[][] stmtArgs = {
++          {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, { new Integer(2) },
++          { new Integer(2) }
++      };
++--- 77,83 ----
++              "update a set b=300 where b>(select b from a X where X.a=?)",
++              true, true)
++      };
++!     public Object[][] stmtArgs = {
++          {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, { new Integer(2) },
++          { new Integer(2) }
++      };
++diff -crN hsqldb-old/src/org/hsqldb/test/TestQuotes.java hsqldb/src/org/hsqldb/test/TestQuotes.java
++*** hsqldb-old/src/org/hsqldb/test/TestQuotes.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestQuotes.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 50,63 ****
++   */
++  public class TestQuotes extends TestCase {
++  
++!     private static final String CREATETABLE =
++          "create table quotetest (test varchar)";
++!     private static final String DELETE = "delete from quotetest";
++!     private static final String TESTSTRING =
++          "insert into quotetest (test) values (?)";
++!     private static final String NOQUOTES = "the house of the dog of kevin";
++!     private static final String QUOTES   = "kevin's dog's house";
++!     private static final String RESULT   = "select * from quotetest";
++  
++      public TestQuotes(String testName) {
++          super(testName);
++--- 50,63 ----
++   */
++  public class TestQuotes extends TestCase {
++  
++!     public static final String CREATETABLE =
++          "create table quotetest (test varchar)";
++!     public static final String DELETE = "delete from quotetest";
++!     public static final String TESTSTRING =
++          "insert into quotetest (test) values (?)";
++!     public static final String NOQUOTES = "the house of the dog of kevin";
++!     public static final String QUOTES   = "kevin's dog's house";
++!     public static final String RESULT   = "select * from quotetest";
++  
++      public TestQuotes(String testName) {
++          super(testName);
++diff -crN hsqldb-old/src/org/hsqldb/test/TestSchemaParse.java hsqldb/src/org/hsqldb/test/TestSchemaParse.java
++*** hsqldb-old/src/org/hsqldb/test/TestSchemaParse.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestSchemaParse.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 42,50 ****
++  
++      Connection                  con = null;
++      Statement                   statement;
++!     private static final String ipref = "INFORMATION_SCHEMA.";
++  
++!     protected void setUp() throws Exception {
++  
++          org.hsqldb.jdbcDriver.class.getName();
++  
++--- 42,50 ----
++  
++      Connection                  con = null;
++      Statement                   statement;
++!     public static final String ipref = "INFORMATION_SCHEMA.";
++  
++!     public void setUp() throws Exception {
++  
++          org.hsqldb.jdbcDriver.class.getName();
++  
++***************
++*** 96,104 ****
++  
++      // Want to permit the SHUTDOWN SQL command in tearDown() to fail iff
++      // the test method run has tested SHUTDOWN.
++!     private boolean shutdownTested = false;
++  
++!     protected void tearDown() throws Exception {
++  
++          // Shut down to destroy all of the DB objects (only works because
++          // it's an in-memory instance.
++--- 96,104 ----
++  
++      // Want to permit the SHUTDOWN SQL command in tearDown() to fail iff
++      // the test method run has tested SHUTDOWN.
++!     public boolean shutdownTested = false;
++  
++!     public void tearDown() throws Exception {
++  
++          // Shut down to destroy all of the DB objects (only works because
++          // it's an in-memory instance.
++***************
++*** 931,941 ****
++      }
++  
++  /** @todo fredt - need to define additional identifiers to use for all cases of expect */
++!     private static final int SQL_ABORT   = -1234;
++!     private static final int SQL_INITIAL = -1233;
++!     private static final int SQL_FAIL    = -1;
++  
++!     private void execSQL(String s, boolean ignoreError) throws SQLException {
++  
++          try {
++              statement.execute(s);
++--- 931,941 ----
++      }
++  
++  /** @todo fredt - need to define additional identifiers to use for all cases of expect */
++!     public static final int SQL_ABORT   = -1234;
++!     public static final int SQL_INITIAL = -1233;
++!     public static final int SQL_FAIL    = -1;
++  
++!     public void execSQL(String s, boolean ignoreError) throws SQLException {
++  
++          try {
++              statement.execute(s);
++***************
++*** 949,955 ****
++          }
++      }
++  
++!     private void execSQL(String m, String s, int expect) {
++  
++          int retval = SQL_INITIAL;
++  
++--- 949,955 ----
++          }
++      }
++  
++!     public void execSQL(String m, String s, int expect) {
++  
++          int retval = SQL_INITIAL;
++  
++***************
++*** 965,975 ****
++      }
++  
++  /** @todo fredt - this method body seems to be incorrect */
++!     private void execSQL(String s, int expect) {
++          execSQL(s, s, expect);
++      }
++  
++!     private int queryRowCount(String query) throws SQLException {
++  
++          int count = 0;
++  
++--- 965,975 ----
++      }
++  
++  /** @todo fredt - this method body seems to be incorrect */
++!     public void execSQL(String s, int expect) {
++          execSQL(s, s, expect);
++      }
++  
++!     public int queryRowCount(String query) throws SQLException {
++  
++          int count = 0;
++  
++***************
++*** 990,996 ****
++          return count;
++      }
++  
++!     private int tableRowCount(String tableName) throws SQLException {
++  
++          String query = "SELECT count(*) FROM " + tableName;
++  
++--- 990,996 ----
++          return count;
++      }
++  
++!     public int tableRowCount(String tableName) throws SQLException {
++  
++          String query = "SELECT count(*) FROM " + tableName;
++  
++diff -crN hsqldb-old/src/org/hsqldb/test/TestSql.java hsqldb/src/org/hsqldb/test/TestSql.java
++*** hsqldb-old/src/org/hsqldb/test/TestSql.java	2007-07-11 14:17:30.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestSql.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 58,64 ****
++          super(name);
++      }
++  
++!     protected void setUp() {
++  
++          super.setUp();
++  
++--- 58,64 ----
++          super(name);
++      }
++  
++!     public void setUp() {
++  
++          super.setUp();
++  
++***************
++*** 732,738 ****
++          }
++      }
++  
++!     protected void tearDown() {
++  
++          try {
++              connection.close();
++--- 732,738 ----
++          }
++      }
++  
++!     public void tearDown() {
++  
++          try {
++              connection.close();
++diff -crN hsqldb-old/src/org/hsqldb/test/TestSqlPersistent.java hsqldb/src/org/hsqldb/test/TestSqlPersistent.java
++*** hsqldb-old/src/org/hsqldb/test/TestSqlPersistent.java	2006-04-11 17:13:24.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestSqlPersistent.java	2007-11-04 00:13:48.000000000 +0100
++***************
++*** 63,69 ****
++          super(name);
++      }
++  
++!     protected void setUp() throws Exception {
++  
++          super.setUp();
++  
++--- 63,69 ----
++          super(name);
++      }
++  
++!     public void setUp() throws Exception {
++  
++          super.setUp();
++  
++***************
++*** 431,437 ****
++          }
++      }
++  
++!     protected void tearDown() {
++  
++          try {
++              cConnection.close();
++--- 431,437 ----
++          }
++      }
++  
++!     public void tearDown() {
++  
++          try {
++              cConnection.close();
++diff -crN hsqldb-old/src/org/hsqldb/test/TestStressInsert.java hsqldb/src/org/hsqldb/test/TestStressInsert.java
++*** hsqldb-old/src/org/hsqldb/test/TestStressInsert.java	2006-07-10 13:28:32.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestStressInsert.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 44,53 ****
++   */
++  public class TestStressInsert {
++  
++!     private Connection        con;
++!     private PreparedStatement insertStmt;
++!     private static final int  MAX_SIZE = 800000;
++!     private final Random      random   = new Random(0);
++      byte[]                    data     = getRandomBytes(MAX_SIZE);
++  
++      public void init() throws Exception {
++--- 44,53 ----
++   */
++  public class TestStressInsert {
++  
++!     public Connection        con;
++!     public PreparedStatement insertStmt;
++!     public static final int  MAX_SIZE = 800000;
++!     public final Random      random   = new Random(0);
++      byte[]                    data     = getRandomBytes(MAX_SIZE);
++  
++      public void init() throws Exception {
++***************
++*** 143,149 ****
++          }
++      }
++  
++!     private byte[] getRandomBytes(int length) {
++  
++          byte[] ret = new byte[length];
++  
++--- 143,149 ----
++          }
++      }
++  
++!     public byte[] getRandomBytes(int length) {
++  
++          byte[] ret = new byte[length];
++  
++diff -crN hsqldb-old/src/org/hsqldb/test/TestSubselect.java hsqldb/src/org/hsqldb/test/TestSubselect.java
++*** hsqldb-old/src/org/hsqldb/test/TestSubselect.java	2007-10-16 08:56:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestSubselect.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 52,67 ****
++      //------------------------------------------------------------
++      // Class variables
++      //------------------------------------------------------------
++!     private static final String databaseDriver = "org.hsqldb.jdbcDriver";
++!     private static final String databaseURL =
++          "jdbc:hsqldb:/hsql/test/subselect";
++!     private static final String databaseUser     = "sa";
++!     private static final String databasePassword = "";
++  
++      //------------------------------------------------------------
++      // Instance variables
++      //------------------------------------------------------------
++!     private Connection jdbcConnection;
++  
++      //------------------------------------------------------------
++      // Constructors
++--- 52,67 ----
++      //------------------------------------------------------------
++      // Class variables
++      //------------------------------------------------------------
++!     public static final String databaseDriver = "org.hsqldb.jdbcDriver";
++!     public static final String databaseURL =
++          "jdbc:hsqldb:/hsql/test/subselect";
++!     public static final String databaseUser     = "sa";
++!     public static final String databasePassword = "";
++  
++      //------------------------------------------------------------
++      // Instance variables
++      //------------------------------------------------------------
++!     public Connection jdbcConnection;
++  
++      //------------------------------------------------------------
++      // Constructors
++***************
++*** 77,88 ****
++      //------------------------------------------------------------
++      // Class methods
++      //------------------------------------------------------------
++!     protected static Connection getJDBCConnection() throws SQLException {
++          return DriverManager.getConnection(databaseURL, databaseUser,
++                                             databasePassword);
++      }
++  
++!     protected void setUp() throws Exception {
++  
++          TestSelf.deleteDatabase("/hsql/test/subselect");
++          Class.forName(databaseDriver);
++--- 77,88 ----
++      //------------------------------------------------------------
++      // Class methods
++      //------------------------------------------------------------
++!     public static Connection getJDBCConnection() throws SQLException {
++          return DriverManager.getConnection(databaseURL, databaseUser,
++                                             databasePassword);
++      }
++  
++!     public void setUp() throws Exception {
++  
++          TestSelf.deleteDatabase("/hsql/test/subselect");
++          Class.forName(databaseDriver);
++***************
++*** 92,98 ****
++          createDataset();
++      }
++  
++!     protected void tearDown() throws Exception {
++  
++          jdbcConnection.close();
++  
++--- 92,98 ----
++          createDataset();
++      }
++  
++!     public void tearDown() throws Exception {
++  
++          jdbcConnection.close();
++  
++***************
++*** 137,143 ****
++      //------------------------------------------------------------
++      // Helper methods
++      //------------------------------------------------------------
++!     private static void compareResults(String sql, String[] expected,
++                                         Connection jdbcConnection)
++                                         throws SQLException {
++  
++--- 137,143 ----
++      //------------------------------------------------------------
++      // Helper methods
++      //------------------------------------------------------------
++!     public static void compareResults(String sql, String[] expected,
++                                         Connection jdbcConnection)
++                                         throws SQLException {
++  
++diff -crN hsqldb-old/src/org/hsqldb/test/TestTextTable.java hsqldb/src/org/hsqldb/test/TestTextTable.java
++*** hsqldb-old/src/org/hsqldb/test/TestTextTable.java	2007-10-16 08:56:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestTextTable.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 46,58 ****
++      java.sql.Statement      m_statement;
++      java.sql.Connection     m_connection;
++  
++!     private class TextTableDescriptor
++      {
++!         private String      m_name;
++!         private String      m_columnSpec;
++!         private String      m_separator;
++!         private String      m_separatorSpec;
++!         private Object[][]  m_data;
++  
++          public TextTableDescriptor( String name, String columnSpec, String separator, String separatorSpec, Object[][] data )
++          {
++--- 46,58 ----
++      java.sql.Statement      m_statement;
++      java.sql.Connection     m_connection;
++  
++!     public class TextTableDescriptor
++      {
++!         public String      m_name;
++!         public String      m_columnSpec;
++!         public String      m_separator;
++!         public String      m_separatorSpec;
++!         public Object[][]  m_data;
++  
++          public TextTableDescriptor( String name, String columnSpec, String separator, String separatorSpec, Object[][] data )
++          {
++***************
++*** 80,86 ****
++  
++          /** creates a text file as described by this instance
++           */
++!         private void createTextFile() {
++  
++              PrintStream textFile = null;
++              try {
++--- 80,86 ----
++  
++          /** creates a text file as described by this instance
++           */
++!         public void createTextFile() {
++  
++              PrintStream textFile = null;
++              try {
++***************
++*** 106,117 ****
++              textFile.close();
++          }
++  
++!         private String getDataSourceSpec()
++          {
++              return m_name + ".csv;encoding=UTF-8;fs=" + m_separatorSpec;
++          }
++  
++!         private void createTable( java.sql.Connection connection ) throws SQLException
++          {
++              String createTable = "DROP TABLE \"" + m_name + "\" IF EXISTS;";
++              createTable += "CREATE TEXT TABLE \"" + m_name + "\" ( " + m_columnSpec + " );";
++--- 106,117 ----
++              textFile.close();
++          }
++  
++!         public String getDataSourceSpec()
++          {
++              return m_name + ".csv;encoding=UTF-8;fs=" + m_separatorSpec;
++          }
++  
++!         public void createTable( java.sql.Connection connection ) throws SQLException
++          {
++              String createTable = "DROP TABLE \"" + m_name + "\" IF EXISTS;";
++              createTable += "CREATE TEXT TABLE \"" + m_name + "\" ( " + m_columnSpec + " );";
++***************
++*** 156,162 ****
++  
++      /** sets up all text files for the test database
++       */
++!     private void setupTextFiles() {
++  
++          m_products.createTextFile();
++          m_customers.createTextFile();
++--- 156,162 ----
++  
++      /** sets up all text files for the test database
++       */
++!     public void setupTextFiles() {
++  
++          m_products.createTextFile();
++          m_customers.createTextFile();
++***************
++*** 164,170 ****
++  
++      /** creates the database tables needed for the test
++       */
++!     private void setupDatabase() {
++  
++          try {
++              m_connection = newConnection();
++--- 164,170 ----
++  
++      /** creates the database tables needed for the test
++       */
++!     public void setupDatabase() {
++  
++          try {
++              m_connection = newConnection();
++***************
++*** 183,196 ****
++          setupDatabase();
++      }
++  
++!     protected void tearDown() {
++          executeStatement("SHUTDOWN");
++          super.tearDown();
++      }
++  
++      /** returns the data source definition for a given text table
++       */
++!     private String getDataSourceSpec( String tableName )
++      {
++          String spec = null;
++          try {
++--- 183,196 ----
++          setupDatabase();
++      }
++  
++!     public void tearDown() {
++          executeStatement("SHUTDOWN");
++          super.tearDown();
++      }
++  
++      /** returns the data source definition for a given text table
++       */
++!     public String getDataSourceSpec( String tableName )
++      {
++          String spec = null;
++          try {
++***************
++*** 207,213 ****
++  
++      /** determines whether a given table is currently read-only
++       */
++!     private boolean isReadOnly( String tableName ) {
++          boolean isReadOnly = true;
++          try {
++              java.sql.ResultSet systemTables = m_statement.executeQuery(
++--- 207,213 ----
++  
++      /** determines whether a given table is currently read-only
++       */
++!     public boolean isReadOnly( String tableName ) {
++          boolean isReadOnly = true;
++          try {
++              java.sql.ResultSet systemTables = m_statement.executeQuery(
++***************
++*** 223,229 ****
++  
++      /** checks different field separators
++       */
++!     private void checkSeparators() {
++  
++          String[][] separators = new String[][] {
++              // special separators
++--- 223,229 ----
++  
++      /** checks different field separators
++       */
++!     public void checkSeparators() {
++  
++          String[][] separators = new String[][] {
++              // special separators
++***************
++*** 275,281 ****
++       *  @param expectedValues
++       *      the values expected in the table
++       */
++!     private void verifyTableContent(String tableName, Object[][] expectedValues) {
++  
++          String selectStmt = "SELECT * FROM \"" + tableName + "\" ORDER BY ID";
++          try
++--- 275,281 ----
++       *  @param expectedValues
++       *      the values expected in the table
++       */
++!     public void verifyTableContent(String tableName, Object[][] expectedValues) {
++  
++          String selectStmt = "SELECT * FROM \"" + tableName + "\" ORDER BY ID";
++          try
++***************
++*** 314,320 ****
++       *  <p>Basically, this method calls <code>m_statement.execute(sql)</code>,
++       *  but wraps any <code>SQLException</code>s into a JUnit error.
++       */
++!     private void executeStatement(String sql) {
++  
++          try {
++              m_statement.execute(sql);
++--- 314,320 ----
++       *  <p>Basically, this method calls <code>m_statement.execute(sql)</code>,
++       *  but wraps any <code>SQLException</code>s into a JUnit error.
++       */
++!     public void executeStatement(String sql) {
++  
++          try {
++              m_statement.execute(sql);
++***************
++*** 325,331 ****
++  
++      /** verifies the initial content of the "products" text table, plus a simple insertion
++       */
++!     private void verifyInitialContent() {
++  
++          verifyTableContent(m_products.getName(), m_products.getData());
++          verifyTableContent(m_customers.getName(), m_customers.getData());
++--- 325,331 ----
++  
++      /** verifies the initial content of the "products" text table, plus a simple insertion
++       */
++!     public void verifyInitialContent() {
++  
++          verifyTableContent(m_products.getName(), m_products.getData());
++          verifyTableContent(m_customers.getName(), m_customers.getData());
++***************
++*** 333,339 ****
++  
++      /** does some very basic insertion tests
++       */
++!     private void checkInsertions() {
++  
++          // check whether inserting a value succeeds
++          executeStatement( "INSERT INTO \"" + m_products.getName() + "\" VALUES ( 3, 'Pears' )" );
++--- 333,339 ----
++  
++      /** does some very basic insertion tests
++       */
++!     public void checkInsertions() {
++  
++          // check whether inserting a value succeeds
++          executeStatement( "INSERT INTO \"" + m_products.getName() + "\" VALUES ( 3, 'Pears' )" );
++***************
++*** 351,357 ****
++      /** verifies whether implicit and explicit dis/connections from/to the text table source work
++       *  as expected
++       */
++!     private void checkSourceConnection() {
++  
++          String sqlSetTable = "SET TABLE \"" + m_products.getName() + "\"";
++          // preconditions for the following tests
++--- 351,357 ----
++      /** verifies whether implicit and explicit dis/connections from/to the text table source work
++       *  as expected
++       */
++!     public void checkSourceConnection() {
++  
++          String sqlSetTable = "SET TABLE \"" + m_products.getName() + "\"";
++          // preconditions for the following tests
++diff -crN hsqldb-old/src/org/hsqldb/test/TestTextTables.java hsqldb/src/org/hsqldb/test/TestTextTables.java
++*** hsqldb-old/src/org/hsqldb/test/TestTextTables.java	2007-05-14 22:51:38.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestTextTables.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 52,65 ****
++          tB();
++      }
++  
++!     private void tA() throws Exception {
++  
++          Connection conn = newConnection();
++  
++          TestUtil.testScript(conn, "TestText01.txt");
++      }
++  
++!     private void tB() throws Exception {
++  
++          Connection conn = newConnection();
++  
++--- 52,65 ----
++          tB();
++      }
++  
++!     public void tA() throws Exception {
++  
++          Connection conn = newConnection();
++  
++          TestUtil.testScript(conn, "TestText01.txt");
++      }
++  
++!     public void tB() throws Exception {
++  
++          Connection conn = newConnection();
++  
++diff -crN hsqldb-old/src/org/hsqldb/test/TestTimestamp.java hsqldb/src/org/hsqldb/test/TestTimestamp.java
++*** hsqldb-old/src/org/hsqldb/test/TestTimestamp.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestTimestamp.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 57,63 ****
++          super(testName);
++      }
++  
++!     private void initOracle() throws Exception {
++  
++          Class.forName("oracle.jdbc.driver.OracleDriver");
++  
++--- 57,63 ----
++          super(testName);
++      }
++  
++!     public void initOracle() throws Exception {
++  
++          Class.forName("oracle.jdbc.driver.OracleDriver");
++  
++***************
++*** 67,73 ****
++          conn.setAutoCommit(false);
++      }
++  
++!     private void initHypersonic() throws Exception {
++  
++          Class.forName("org.hsqldb.jdbcDriver");
++  
++--- 67,73 ----
++          conn.setAutoCommit(false);
++      }
++  
++!     public void initHypersonic() throws Exception {
++  
++          Class.forName("org.hsqldb.jdbcDriver");
++  
++***************
++*** 102,110 ****
++  //        dropTestTable();
++      }
++  */
++!     private void checkExceptionTableExistsOracle(SQLException e) {}
++  
++!     private void checkExceptionTableExistsHsql(SQLException e) {
++  
++          Assert.assertTrue("Error code of SQLException is wrong",
++                            e.getErrorCode()
++--- 102,110 ----
++  //        dropTestTable();
++      }
++  */
++!     public void checkExceptionTableExistsOracle(SQLException e) {}
++  
++!     public void checkExceptionTableExistsHsql(SQLException e) {
++  
++          Assert.assertTrue("Error code of SQLException is wrong",
++                            e.getErrorCode()
++***************
++*** 151,157 ****
++  //        dropTestTable();
++      }
++  
++!     private void dropAllTables() throws Exception {
++  
++          dropTestTable(nameTable);
++          dropTestTable("\"SITE_LIST_SITE\"");
++--- 151,157 ----
++  //        dropTestTable();
++      }
++  
++!     public void dropAllTables() throws Exception {
++  
++          dropTestTable(nameTable);
++          dropTestTable("\"SITE_LIST_SITE\"");
++***************
++*** 161,169 ****
++          dropTestTable("\"CASH_CURR_VALUE\"");
++      }
++  
++!     private String nameTable = null;
++  
++!     private void doTest() throws Exception {
++  
++          PreparedStatement ps = conn.prepareStatement("select max(T) T1 from "
++              + nameTable + " where ID=?");
++--- 161,169 ----
++          dropTestTable("\"CASH_CURR_VALUE\"");
++      }
++  
++!     public String nameTable = null;
++  
++!     public void doTest() throws Exception {
++  
++          PreparedStatement ps = conn.prepareStatement("select max(T) T1 from "
++              + nameTable + " where ID=?");
++***************
++*** 217,226 ****
++          }
++      }
++  
++!     private static Timestamp testTS =
++          new Timestamp(System.currentTimeMillis());
++  
++!     private void insertTestData() throws Exception {
++  
++  //        conn.createStatement().executeUpdate("INSERT INTO \"SITE_LIST_SITE\" VALUES(23,1,'ru','RU',NULL,'\u041f\u0440\u043e\u0431\u043d\u044b\u0439 \u0441\u0430\u0439\u0442',NULL,0,'''/front_styles.css''',1,NULL,0)");
++  //        conn.createStatement().executeUpdate("INSERT INTO \"SITE_VIRTUAL_HOST\" VALUES(36,23,'test-host')");
++--- 217,226 ----
++          }
++      }
++  
++!     public static Timestamp testTS =
++          new Timestamp(System.currentTimeMillis());
++  
++!     public void insertTestData() throws Exception {
++  
++  //        conn.createStatement().executeUpdate("INSERT INTO \"SITE_LIST_SITE\" VALUES(23,1,'ru','RU',NULL,'\u041f\u0440\u043e\u0431\u043d\u044b\u0439 \u0441\u0430\u0439\u0442',NULL,0,'''/front_styles.css''',1,NULL,0)");
++  //        conn.createStatement().executeUpdate("INSERT INTO \"SITE_VIRTUAL_HOST\" VALUES(36,23,'test-host')");
++***************
++*** 245,251 ****
++          conn.commit();
++      }
++  
++!     private void createTestTable(String sql) throws Exception {
++  
++          Statement ps = conn.createStatement();
++  
++--- 245,251 ----
++          conn.commit();
++      }
++  
++!     public void createTestTable(String sql) throws Exception {
++  
++          Statement ps = conn.createStatement();
++  
++***************
++*** 255,261 ****
++          ps = null;
++      }
++  
++!     private void dropTestTable(String nameTableDrop) throws Exception {
++  
++          String    sql = "drop table " + nameTableDrop;
++          Statement ps  = conn.createStatement();
++--- 255,261 ----
++          ps = null;
++      }
++  
++!     public void dropTestTable(String nameTableDrop) throws Exception {
++  
++          String    sql = "drop table " + nameTableDrop;
++          Statement ps  = conn.createStatement();
++***************
++*** 269,282 ****
++          ps = null;
++      }
++  
++!     private void setTimeZone() {
++  
++          timeZone = TimeZone.getTimeZone("Asia/Irkutsk");
++  
++          TimeZone.setDefault(timeZone);
++      }
++  
++!     private Timestamp getCurrentCurs() throws Exception {
++  
++          long idCurrency = 134;
++          long idSite     = 23;
++--- 269,282 ----
++          ps = null;
++      }
++  
++!     public void setTimeZone() {
++  
++          timeZone = TimeZone.getTimeZone("Asia/Irkutsk");
++  
++          TimeZone.setDefault(timeZone);
++      }
++  
++!     public Timestamp getCurrentCurs() throws Exception {
++  
++          long idCurrency = 134;
++          long idSite     = 23;
++diff -crN hsqldb-old/src/org/hsqldb/test/TestUtil.java hsqldb/src/org/hsqldb/test/TestUtil.java
++*** hsqldb-old/src/org/hsqldb/test/TestUtil.java	2006-02-16 04:48:00.000000000 +0100
++--- hsqldb/src/org/hsqldb/test/TestUtil.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 174,180 ****
++       * SQL for the statement).
++       * @param line line of the script file where this section started
++       */
++!     private static void testSection(Statement stat, HsqlArrayList section,
++                                      int line) {
++  
++          //create an appropriate instance of ParsedSection
++--- 174,180 ----
++       * SQL for the statement).
++       * @param line line of the script file where this section started
++       */
++!     public static void testSection(Statement stat, HsqlArrayList section,
++                                      int line) {
++  
++          //create an appropriate instance of ParsedSection
++***************
++*** 201,207 ****
++       * @param aSection Vector containing the section of script
++       * @return a ParesedSection object
++       */
++!     private static ParsedSection parsedSectionFactory(
++              HsqlArrayList aSection) {
++  
++          //type of the section
++--- 201,207 ----
++       * @param aSection Vector containing the section of script
++       * @return a ParesedSection object
++       */
++!     public static ParsedSection parsedSectionFactory(
++              HsqlArrayList aSection) {
++  
++          //type of the section
++***************
++*** 298,329 ****
++       * Type of this test.
++       * @see isValidCase() for allowed values
++       */
++!     protected char type = ' ';
++  
++      /** error message for this section */
++      String message = null;
++  
++      /** contents of the section as an array of Strings, one for each line in the section. */
++!     protected String[] lines = null;
++  
++      /** number of the last row containing results in sectionLines */
++!     protected int resEndRow = 0;
++  
++      /** SQL query to be submitted to the database. */
++!     protected String sqlString = null;
++  
++      /**
++       * Constructor when the section's input lines do not need to be parsed
++       * into SQL.
++       */
++!     protected ParsedSection() {}
++  
++      /**
++       * Common constructor functions for this family.
++       * @param aLines Array of the script lines containing the section of script.
++       * database
++       */
++!     protected ParsedSection(String[] aLines) {
++  
++          lines = aLines;
++  
++--- 298,329 ----
++       * Type of this test.
++       * @see isValidCase() for allowed values
++       */
++!     public char type = ' ';
++  
++      /** error message for this section */
++      String message = null;
++  
++      /** contents of the section as an array of Strings, one for each line in the section. */
++!     public String[] lines = null;
++  
++      /** number of the last row containing results in sectionLines */
++!     public int resEndRow = 0;
++  
++      /** SQL query to be submitted to the database. */
++!     public String sqlString = null;
++  
++      /**
++       * Constructor when the section's input lines do not need to be parsed
++       * into SQL.
++       */
++!     public ParsedSection() {}
++  
++      /**
++       * Common constructor functions for this family.
++       * @param aLines Array of the script lines containing the section of script.
++       * database
++       */
++!     public ParsedSection(String[] aLines) {
++  
++          lines = aLines;
++  
++***************
++*** 400,413 ****
++       * returns a String representation of the expected result for the test
++       * @return The expected result(s) for the test
++       */
++!     protected abstract String getResultString();
++  
++      /**
++       *  returns the error message for the section
++       *
++       * @return message
++       */
++!     protected String getMessage() {
++          return message;
++      }
++  
++--- 400,413 ----
++       * returns a String representation of the expected result for the test
++       * @return The expected result(s) for the test
++       */
++!     public abstract String getResultString();
++  
++      /**
++       *  returns the error message for the section
++       *
++       * @return message
++       */
++!     public String getMessage() {
++          return message;
++      }
++  
++***************
++*** 415,421 ****
++       * returns the type of this section
++       * @return type of this section
++       */
++!     protected char getType() {
++          return type;
++      }
++  
++--- 415,421 ----
++       * returns the type of this section
++       * @return type of this section
++       */
++!     public char getType() {
++          return type;
++      }
++  
++***************
++*** 423,429 ****
++       * returns the SQL statement for this section
++       * @return SQL statement for this section
++       */
++!     protected String getSql() {
++          return sqlString;
++      }
++  
++--- 423,429 ----
++       * returns the SQL statement for this section
++       * @return SQL statement for this section
++       */
++!     public String getSql() {
++          return sqlString;
++      }
++  
++***************
++*** 432,438 ****
++       * @param aStatement Statement object
++       * @return true if the result(s) are as expected, otherwise false
++       */
++!     protected boolean test(Statement aStatement) {
++  
++          try {
++              aStatement.execute(getSql());
++--- 432,438 ----
++       * @param aStatement Statement object
++       * @return true if the result(s) are as expected, otherwise false
++       */
++!     public boolean test(Statement aStatement) {
++  
++          try {
++              aStatement.execute(getSql());
++***************
++*** 450,456 ****
++       * @param aCode type code to validate.
++       * @return true if the type code is valid, otherwise false.
++       */
++!     protected static boolean isValidCode(char aCode) {
++  
++          /* Allowed values for test codes are:
++           * (note that UPPERCASE codes, while valid are only processed if the
++--- 450,456 ----
++       * @param aCode type code to validate.
++       * @return true if the type code is valid, otherwise false.
++       */
++!     public static boolean isValidCode(char aCode) {
++  
++          /* Allowed values for test codes are:
++           * (note that UPPERCASE codes, while valid are only processed if the
++***************
++*** 485,499 ****
++  /** Represents a ParsedSection for a ResultSet test */
++  class ResultSetParsedSection extends ParsedSection {
++  
++!     private String delim = System.getProperty("TestUtilFieldDelimiter", ",");
++!     private String[] expectedRows = null;
++  
++      /**
++       * constructs a new instance of ResultSetParsedSection, interpreting
++       * the supplied results as one or more lines of delimited field values
++       * @param lines String[]
++       */
++!     protected ResultSetParsedSection(String[] lines) {
++  
++          super(lines);
++  
++--- 485,499 ----
++  /** Represents a ParsedSection for a ResultSet test */
++  class ResultSetParsedSection extends ParsedSection {
++  
++!     public String delim = System.getProperty("TestUtilFieldDelimiter", ",");
++!     public String[] expectedRows = null;
++  
++      /**
++       * constructs a new instance of ResultSetParsedSection, interpreting
++       * the supplied results as one or more lines of delimited field values
++       * @param lines String[]
++       */
++!     public ResultSetParsedSection(String[] lines) {
++  
++          super(lines);
++  
++***************
++*** 509,515 ****
++          }
++      }
++  
++!     protected String getResultString() {
++  
++          StringBuffer printVal = new StringBuffer();
++  
++--- 509,515 ----
++          }
++      }
++  
++!     public String getResultString() {
++  
++          StringBuffer printVal = new StringBuffer();
++  
++***************
++*** 520,526 ****
++          return printVal.toString();
++      }
++  
++!     protected boolean test(Statement aStatement) {
++  
++          try {
++              try {
++--- 520,526 ----
++          return printVal.toString();
++      }
++  
++!     public boolean test(Statement aStatement) {
++  
++          try {
++              try {
++***************
++*** 620,626 ****
++          return true;
++      }
++  
++!     private String[] getExpectedRows() {
++          return expectedRows;
++      }
++  }
++--- 620,626 ----
++          return true;
++      }
++  
++!     public String[] getExpectedRows() {
++          return expectedRows;
++      }
++  }
++***************
++*** 631,637 ****
++      //expected update count
++      int countWeWant;
++  
++!     protected UpdateParsedSection(String[] lines) {
++  
++          super(lines);
++  
++--- 631,637 ----
++      //expected update count
++      int countWeWant;
++  
++!     public UpdateParsedSection(String[] lines) {
++  
++          super(lines);
++  
++***************
++*** 639,653 ****
++          countWeWant = Integer.parseInt(lines[0]);
++      }
++  
++!     protected String getResultString() {
++          return Integer.toString(getCountWeWant());
++      }
++  
++!     private int getCountWeWant() {
++          return countWeWant;
++      }
++  
++!     protected boolean test(Statement aStatement) {
++  
++          try {
++              try {
++--- 639,653 ----
++          countWeWant = Integer.parseInt(lines[0]);
++      }
++  
++!     public String getResultString() {
++          return Integer.toString(getCountWeWant());
++      }
++  
++!     public int getCountWeWant() {
++          return countWeWant;
++      }
++  
++!     public boolean test(Statement aStatement) {
++  
++          try {
++              try {
++***************
++*** 680,697 ****
++  /** Represents a ParsedSection for silent execution */
++  class SilentParsedSection extends ParsedSection {
++  
++!     protected SilentParsedSection(String[] lines) {
++  
++          super(lines);
++  
++          type = 's';
++      }
++  
++!     protected String getResultString() {
++          return null;
++      }
++  
++!     protected boolean test(Statement aStatement) {
++  
++          try {
++              aStatement.execute(getSql());
++--- 680,697 ----
++  /** Represents a ParsedSection for silent execution */
++  class SilentParsedSection extends ParsedSection {
++  
++!     public SilentParsedSection(String[] lines) {
++  
++          super(lines);
++  
++          type = 's';
++      }
++  
++!     public String getResultString() {
++          return null;
++      }
++  
++!     public boolean test(Statement aStatement) {
++  
++          try {
++              aStatement.execute(getSql());
++***************
++*** 705,713 ****
++  class CountParsedSection extends ParsedSection {
++  
++      //expected row count
++!     private int countWeWant;
++  
++!     protected CountParsedSection(String[] lines) {
++  
++          super(lines);
++  
++--- 705,713 ----
++  class CountParsedSection extends ParsedSection {
++  
++      //expected row count
++!     public int countWeWant;
++  
++!     public CountParsedSection(String[] lines) {
++  
++          super(lines);
++  
++***************
++*** 715,729 ****
++          countWeWant = Integer.parseInt(lines[0]);
++      }
++  
++!     protected String getResultString() {
++          return Integer.toString(getCountWeWant());
++      }
++  
++!     private int getCountWeWant() {
++          return countWeWant;
++      }
++  
++!     protected boolean test(Statement aStatement) {
++  
++          try {
++  
++--- 715,729 ----
++          countWeWant = Integer.parseInt(lines[0]);
++      }
++  
++!     public String getResultString() {
++          return Integer.toString(getCountWeWant());
++      }
++  
++!     public int getCountWeWant() {
++          return countWeWant;
++      }
++  
++!     public boolean test(Statement aStatement) {
++  
++          try {
++  
++***************
++*** 774,791 ****
++  /** Represents a ParsedSection for an Exception test */
++  class ExceptionParsedSection extends ParsedSection {
++  
++!     protected ExceptionParsedSection(String[] lines) {
++  
++          super(lines);
++  
++          type = 'e';
++      }
++  
++!     protected String getResultString() {
++          return "SQLException";
++      }
++  
++!     protected boolean test(Statement aStatement) {
++  
++          try {
++              aStatement.execute(getSql());
++--- 774,791 ----
++  /** Represents a ParsedSection for an Exception test */
++  class ExceptionParsedSection extends ParsedSection {
++  
++!     public ExceptionParsedSection(String[] lines) {
++  
++          super(lines);
++  
++          type = 'e';
++      }
++  
++!     public String getResultString() {
++          return "SQLException";
++      }
++  
++!     public boolean test(Statement aStatement) {
++  
++          try {
++              aStatement.execute(getSql());
++***************
++*** 804,817 ****
++  /** Represents a ParsedSection for a section with blank type */
++  class BlankParsedSection extends ParsedSection {
++  
++!     protected BlankParsedSection(String[] lines) {
++  
++          super(lines);
++  
++          type = ' ';
++      }
++  
++!     protected String getResultString() {
++          return "No result specified for this section";
++      }
++  }
++--- 804,817 ----
++  /** Represents a ParsedSection for a section with blank type */
++  class BlankParsedSection extends ParsedSection {
++  
++!     public BlankParsedSection(String[] lines) {
++  
++          super(lines);
++  
++          type = ' ';
++      }
++  
++!     public String getResultString() {
++          return "No result specified for this section";
++      }
++  }
++***************
++*** 819,825 ****
++  /** Represents a ParsedSection that is to be ignored */
++  class IgnoreParsedSection extends ParsedSection {
++  
++!     protected IgnoreParsedSection(String[] inLines, char aType) {
++  
++          /* Extremely ambiguous to use input parameter of same exact
++           * variable name as the superclass member "lines".
++--- 819,825 ----
++  /** Represents a ParsedSection that is to be ignored */
++  class IgnoreParsedSection extends ParsedSection {
++  
++!     public IgnoreParsedSection(String[] inLines, char aType) {
++  
++          /* Extremely ambiguous to use input parameter of same exact
++           * variable name as the superclass member "lines".
++***************
++*** 833,839 ****
++          type = aType;
++      }
++  
++!     protected String getResultString() {
++          return "This section, of type '" + getType() + "' was ignored";
++      }
++  }
++--- 833,839 ----
++          type = aType;
++      }
++  
++!     public String getResultString() {
++          return "This section, of type '" + getType() + "' was ignored";
++      }
++  }
++***************
++*** 841,847 ****
++  /** Represents a Section to be Displayed, not executed */
++  class DisplaySection extends ParsedSection {
++  
++!     protected DisplaySection(String[] inLines) {
++  
++          /* Can't user the super constructor, since it does funny things when
++           * constructing the SQL Buffer, which we don't need. */
++--- 841,847 ----
++  /** Represents a Section to be Displayed, not executed */
++  class DisplaySection extends ParsedSection {
++  
++!     public DisplaySection(String[] inLines) {
++  
++          /* Can't user the super constructor, since it does funny things when
++           * constructing the SQL Buffer, which we don't need. */
++***************
++*** 852,858 ****
++          lines[0] = lines[0].substring(firstSlash + 1);
++      }
++  
++!     protected String getResultString() {
++  
++          StringBuffer sb = new StringBuffer();
++  
++--- 852,858 ----
++          lines[0] = lines[0].substring(firstSlash + 1);
++      }
++  
++!     public String getResultString() {
++  
++          StringBuffer sb = new StringBuffer();
++  
++diff -crN hsqldb-old/src/org/hsqldb/test/TestViewAsterisks.java hsqldb/src/org/hsqldb/test/TestViewAsterisks.java
++*** hsqldb-old/src/org/hsqldb/test/TestViewAsterisks.java	2007-10-16 08:56:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/test/TestViewAsterisks.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 67,73 ****
++      /**
++       * creates the database tables needed for the test
++       */
++!     private void setupDatabase() {
++  
++          try {
++              m_connection = newConnection();
++--- 67,73 ----
++      /**
++       * creates the database tables needed for the test
++       */
++!     public void setupDatabase() {
++  
++          try {
++              m_connection = newConnection();
++***************
++*** 98,104 ****
++          setupDatabase();
++      }
++  
++!     protected void tearDown() {
++          executeStatement("SHUTDOWN");
++          super.tearDown();
++      }
++--- 98,104 ----
++          setupDatabase();
++      }
++  
++!     public void tearDown() {
++          executeStatement("SHUTDOWN");
++          super.tearDown();
++      }
++***************
++*** 109,119 ****
++       *  <p>Basically, this method calls <code>m_statement.execute(sql)</code>,
++       *  but wraps any <code>SQLException</code>s into a JUnit error.
++       */
++!     private void executeStatement(String sql) {
++          executeStatement(sql, 0);
++      }
++  
++!     private void executeStatement(String sql, int expectedVendorCode) {
++  
++          try {
++              m_statement.execute(sql);
++--- 109,119 ----
++       *  <p>Basically, this method calls <code>m_statement.execute(sql)</code>,
++       *  but wraps any <code>SQLException</code>s into a JUnit error.
++       */
++!     public void executeStatement(String sql) {
++          executeStatement(sql, 0);
++      }
++  
++!     public void executeStatement(String sql, int expectedVendorCode) {
++  
++          try {
++              m_statement.execute(sql);
++***************
++*** 143,149 ****
++       *  @param viewStatement
++       *      the statement of the view
++       */
++!     private void createView(String viewName, String[] columnList,
++                              String viewStatement) throws SQLException {
++  
++          StringBuffer colList = new StringBuffer();
++--- 143,149 ----
++       *  @param viewStatement
++       *      the statement of the view
++       */
++!     public void createView(String viewName, String[] columnList,
++                              String viewStatement) throws SQLException {
++  
++          StringBuffer colList = new StringBuffer();
++***************
++*** 173,179 ****
++      /**
++       *  retrieves the statement which defines a given view
++       */
++!     private String getViewStatement(String viewName) throws SQLException {
++  
++          ResultSet res = m_statement.executeQuery(
++              "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS WHERE TABLE_NAME = '"
++--- 173,179 ----
++      /**
++       *  retrieves the statement which defines a given view
++       */
++!     public String getViewStatement(String viewName) throws SQLException {
++  
++          ResultSet res = m_statement.executeQuery(
++              "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS WHERE TABLE_NAME = '"
++***************
++*** 189,195 ****
++      /**
++       *  ensures two tables (or views, that is) have the same content
++       */
++!     private void ensureEqualContent(String tableNameLHS,
++                                      String tableNameRHS) throws SQLException {
++  
++          ResultSet lhs = m_statement.executeQuery("SELECT * FROM \""
++--- 189,195 ----
++      /**
++       *  ensures two tables (or views, that is) have the same content
++       */
++!     public void ensureEqualContent(String tableNameLHS,
++                                      String tableNameRHS) throws SQLException {
++  
++          ResultSet lhs = m_statement.executeQuery("SELECT * FROM \""
++***************
++*** 215,221 ****
++      /**
++       *  ensures the content of a given table matches a given object array's content
++       */
++!     private void ensureTableContent(String tableName,
++                                      Object[][] tableData) throws SQLException {
++  
++          ResultSet lhs = m_statement.executeQuery("SELECT * FROM \""
++--- 215,221 ----
++      /**
++       *  ensures the content of a given table matches a given object array's content
++       */
++!     public void ensureTableContent(String tableName,
++                                      Object[][] tableData) throws SQLException {
++  
++          ResultSet lhs = m_statement.executeQuery("SELECT * FROM \""
++***************
++*** 257,263 ****
++       *      string, it is interpreted as name of the table which must have the same content as a view. If
++       *      it's no string either, it must be a two-dimensional Object array specifying the expected content.
++       */
++!     private void checkViewTranslationAndContent(String viewName,
++              String[] columnList, String viewStatement,
++              String expectedTranslatedStatement,
++              Object expectedContent) throws SQLException {
++--- 257,263 ----
++       *      string, it is interpreted as name of the table which must have the same content as a view. If
++       *      it's no string either, it must be a two-dimensional Object array specifying the expected content.
++       */
++!     public void checkViewTranslationAndContent(String viewName,
++              String[] columnList, String viewStatement,
++              String expectedTranslatedStatement,
++              Object expectedContent) throws SQLException {
++***************
++*** 293,299 ****
++      /**
++       *  ensures that a given table has columns with a given name
++       */
++!     private void ensureTableColumns(String tableName,
++                                      String[] columnNames) throws SQLException {
++  
++          ResultSet res = m_connection.getMetaData().getColumns(null, null,
++--- 293,299 ----
++      /**
++       *  ensures that a given table has columns with a given name
++       */
++!     public void ensureTableColumns(String tableName,
++                                      String[] columnNames) throws SQLException {
++  
++          ResultSet res = m_connection.getMetaData().getColumns(null, null,
++***************
++*** 315,321 ****
++      /**
++       *  checks views selecting an asterisk from a table, in different flavours
++       */
++!     private void checkSimpleViews() throws SQLException {
++  
++          // ................................................................
++          // SELECT *
++--- 315,321 ----
++      /**
++       *  checks views selecting an asterisk from a table, in different flavours
++       */
++!     public void checkSimpleViews() throws SQLException {
++  
++          // ................................................................
++          // SELECT *
++***************
++*** 389,395 ****
++      /**
++       *  checks views selecting an asterisk plus existing columns
++       */
++!     private void checkAsterisksCombined() throws SQLException {
++  
++          // ................................................................
++          checkViewTranslationAndContent(
++--- 389,395 ----
++      /**
++       *  checks views selecting an asterisk plus existing columns
++       */
++!     public void checkAsterisksCombined() throws SQLException {
++  
++          // ................................................................
++          checkViewTranslationAndContent(
++***************
++*** 419,425 ****
++      /**
++       *  checks views selecting asterisks from multiple tables
++       */
++!     private void checkMultipleTables() throws SQLException {
++  
++          // ................................................................
++          checkViewTranslationAndContent(
++--- 419,425 ----
++      /**
++       *  checks views selecting asterisks from multiple tables
++       */
++!     public void checkMultipleTables() throws SQLException {
++  
++          // ................................................................
++          checkViewTranslationAndContent(
++***************
++*** 473,479 ****
++      /**
++       *  checks views selecting from sub selects
++       */
++!     private void checkSubSelects() throws SQLException {
++  
++          // ................................................................
++          checkViewTranslationAndContent(
++--- 473,479 ----
++      /**
++       *  checks views selecting from sub selects
++       */
++!     public void checkSubSelects() throws SQLException {
++  
++          // ................................................................
++          checkViewTranslationAndContent(
++***************
++*** 504,510 ****
++      /**
++       *  checks views which are defined using a column list
++       */
++!     private void checkColumnLists() throws SQLException {
++  
++          // just to ensure the column count handling is as expected, else below tests might be useless
++          executeStatement("CREATE VIEW IMPOSSIBLE (\"A\") AS SELECT * FROM ABC",
++--- 504,510 ----
++      /**
++       *  checks views which are defined using a column list
++       */
++!     public void checkColumnLists() throws SQLException {
++  
++          // just to ensure the column count handling is as expected, else below tests might be useless
++          executeStatement("CREATE VIEW IMPOSSIBLE (\"A\") AS SELECT * FROM ABC",
++***************
++*** 522,528 ****
++      /**
++       *  checks views based on other views
++       */
++!     private void checkViewsOnViews() throws SQLException {
++  
++          // ................................................................
++          // not that it should make any difference whether we SELECT FROM a table or view, but who knows
++--- 522,528 ----
++      /**
++       *  checks views based on other views
++       */
++!     public void checkViewsOnViews() throws SQLException {
++  
++          // ................................................................
++          // not that it should make any difference whether we SELECT FROM a table or view, but who knows
++***************
++*** 534,540 ****
++      /**
++       *  checks views based on a UNION statement
++       */
++!     private void checkUnionViews() throws SQLException {
++  
++          checkViewTranslationAndContent(
++              "U1", null, "SELECT * FROM TABLE_A UNION SELECT * FROM TABLE_B",
++--- 534,540 ----
++      /**
++       *  checks views based on a UNION statement
++       */
++!     public void checkUnionViews() throws SQLException {
++  
++          checkViewTranslationAndContent(
++              "U1", null, "SELECT * FROM TABLE_A UNION SELECT * FROM TABLE_B",
++diff -crN hsqldb-old/src/org/hsqldb/TextTable.java hsqldb/src/org/hsqldb/TextTable.java
++*** hsqldb-old/src/org/hsqldb/TextTable.java	2007-10-11 11:32:16.000000000 +0200
++--- hsqldb/src/org/hsqldb/TextTable.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 48,56 ****
++   */
++  class TextTable extends org.hsqldb.Table {
++  
++!     private String  dataSource  = "";
++!     private boolean isReversed  = false;
++!     private boolean isConnected = false;
++  
++      /**
++       *  Constructs a new TextTable from the given arguments.
++--- 48,56 ----
++   */
++  class TextTable extends org.hsqldb.Table {
++  
++!     public String  dataSource  = "";
++!     public boolean isReversed  = false;
++!     public boolean isConnected = false;
++  
++      /**
++       *  Constructs a new TextTable from the given arguments.
++***************
++*** 69,75 ****
++      /**
++       * common handling for all errors during <code>connect</code>
++       */
++!     private void onConnectError(Session session) {
++  
++          if (cache != null) {
++              try {
++--- 69,75 ----
++      /**
++       * common handling for all errors during <code>connect</code>
++       */
++!     public void onConnectError(Session session) {
++  
++          if (cache != null) {
++              try {
++***************
++*** 96,102 ****
++      /**
++       * connects to the data source
++       */
++!     private void connect(Session session,
++                           boolean withReadOnlyData) throws HsqlException {
++  
++          // Open new cache:
++--- 96,102 ----
++      /**
++       * connects to the data source
++       */
++!     public void connect(Session session,
++                           boolean withReadOnlyData) throws HsqlException {
++  
++          // Open new cache:
++***************
++*** 184,190 ****
++       *
++       * Better clarification of the role of the methods is needed.
++       */
++!     private void openCache(Session session, String dataSourceNew,
++                             boolean isReversedNew,
++                             boolean isReadOnlyNew) throws HsqlException {
++  
++--- 184,190 ----
++       *
++       * Better clarification of the role of the methods is needed.
++       */
++!     public void openCache(Session session, String dataSourceNew,
++                             boolean isReversedNew,
++                             boolean isReadOnlyNew) throws HsqlException {
++  
++***************
++*** 204,210 ****
++       * High level command to assign a data source to the table definition.
++       * Reassigns only if the data source or direction has changed.
++       */
++!     protected void setDataSource(Session session, String dataSourceNew,
++                                   boolean isReversedNew,
++                                   boolean newFile) throws HsqlException {
++  
++--- 204,210 ----
++       * High level command to assign a data source to the table definition.
++       * Reassigns only if the data source or direction has changed.
++       */
++!     public void setDataSource(Session session, String dataSourceNew,
++                                   boolean isReversedNew,
++                                   boolean newFile) throws HsqlException {
++  
++***************
++*** 231,241 ****
++          }
++      }
++  
++!     protected String getDataSource() {
++          return dataSource;
++      }
++  
++!     protected boolean isDescDataSource() {
++          return isReversed;
++      }
++  
++--- 231,241 ----
++          }
++      }
++  
++!     public String getDataSource() {
++          return dataSource;
++      }
++  
++!     public boolean isDescDataSource() {
++          return isReversed;
++      }
++  
++***************
++*** 293,299 ****
++          return false;
++      }
++  
++!     protected Table duplicate() throws HsqlException {
++          return new TextTable(database, tableName, getTableType());
++      }
++  
++--- 293,299 ----
++          return false;
++      }
++  
++!     public Table duplicate() throws HsqlException {
++          return new TextTable(database, tableName, getTableType());
++      }
++  
++diff -crN hsqldb-old/src/org/hsqldb/Tokenizer.java hsqldb/src/org/hsqldb/Tokenizer.java
++*** hsqldb-old/src/org/hsqldb/Tokenizer.java	2007-07-23 20:30:48.000000000 +0200
++--- hsqldb/src/org/hsqldb/Tokenizer.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 98,104 ****
++   */
++  public class Tokenizer {
++  
++!     private static final int NO_TYPE     = 0,
++                               NAME        = 1,
++                               LONG_NAME   = 2,
++                               SPECIAL     = 3,
++--- 98,104 ----
++   */
++  public class Tokenizer {
++  
++!     public static final int NO_TYPE     = 0,
++                               NAME        = 1,
++                               LONG_NAME   = 2,
++                               SPECIAL     = 3,
++***************
++*** 115,143 ****
++                               NAMED_PARAM = 14;
++  
++      // used only internally
++!     private static final int QUOTED_IDENTIFIER = 15,
++                               REMARK_LINE       = 16,
++                               REMARK            = 17;
++!     private String           sCommand;
++!     private int              iLength;
++!     private int              iIndex;
++!     private int              tokenIndex;
++!     private int              nextTokenIndex;
++!     private int              beginIndex;
++!     private int              iType;
++!     private String           sToken;
++!     private int              indexLongNameFirst = -1;
++!     private String           sLongNameFirst = null;
++!     private int              typeLongNameFirst;
++  
++      // getToken() will clear LongNameFirst unless retainFirst is set.
++!     private boolean retainFirst = false;
++  
++! //    private String           sLongNameLast;
++      // WAIT.  Don't do anything before popping another Token (because the
++      // state variables aren't set properly due to a call of wait()).
++!     private boolean bWait;
++!     private boolean lastTokenQuotedID;
++  
++      // literals that are values
++      static IntValueHashMap valueTokens;
++--- 115,143 ----
++                               NAMED_PARAM = 14;
++  
++      // used only internally
++!     public static final int QUOTED_IDENTIFIER = 15,
++                               REMARK_LINE       = 16,
++                               REMARK            = 17;
++!     public String           sCommand;
++!     public int              iLength;
++!     public int              iIndex;
++!     public int              tokenIndex;
++!     public int              nextTokenIndex;
++!     public int              beginIndex;
++!     public int              iType;
++!     public String           sToken;
++!     public int              indexLongNameFirst = -1;
++!     public String           sLongNameFirst = null;
++!     public int              typeLongNameFirst;
++  
++      // getToken() will clear LongNameFirst unless retainFirst is set.
++!     public boolean retainFirst = false;
++  
++! //    public String           sLongNameLast;
++      // WAIT.  Don't do anything before popping another Token (because the
++      // state variables aren't set properly due to a call of wait()).
++!     public boolean bWait;
++!     public boolean lastTokenQuotedID;
++  
++      // literals that are values
++      static IntValueHashMap valueTokens;
++***************
++*** 733,739 ****
++       *
++       * @throws HsqlException
++       */
++!     private void getToken() throws HsqlException {
++  
++          if (bWait) {
++              bWait  = false;
++--- 733,739 ----
++       *
++       * @throws HsqlException
++       */
++!     public void getToken() throws HsqlException {
++  
++          if (bWait) {
++              bWait  = false;
++***************
++*** 1117,1123 ****
++  // because these strings might end up as part of internal data structures
++  // or table elements.
++  // we may consider using pools to avoid recreating the strings
++!     private String getString(char quoteChar) throws HsqlException {
++  
++          try {
++              int     nextIndex   = iIndex;
++--- 1117,1123 ----
++  // because these strings might end up as part of internal data structures
++  // or table elements.
++  // we may consider using pools to avoid recreating the strings
++!     public String getString(char quoteChar) throws HsqlException {
++  
++          try {
++              int     nextIndex   = iIndex;
++diff -crN hsqldb-old/src/org/hsqldb/Token.java hsqldb/src/org/hsqldb/Token.java
++*** hsqldb-old/src/org/hsqldb/Token.java	2007-06-21 10:31:36.000000000 +0200
++--- hsqldb/src/org/hsqldb/Token.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 45,51 ****
++   */
++  public class Token {
++  
++!     private static IntValueHashMap commandSet;
++  
++      //
++      static final String        T_ASTERISK     = "*";
++--- 45,51 ----
++   */
++  public class Token {
++  
++!     public static IntValueHashMap commandSet;
++  
++      //
++      static final String        T_ASTERISK     = "*";
++***************
++*** 708,714 ****
++       *
++       * @return a new map for the database command token set
++       */
++!     private static IntValueHashMap newCommandSet() {
++  
++          IntValueHashMap commandSet;
++  
++--- 708,714 ----
++       *
++       * @return a new map for the database command token set
++       */
++!     public static IntValueHashMap newCommandSet() {
++  
++          IntValueHashMap commandSet;
++  
++***************
++*** 790,796 ****
++          return commandSet.get(token, -1);
++      }
++  
++!     private static HashSet keywords;
++      static IntValueHashMap valueTokens;
++  
++      static {
++--- 790,796 ----
++          return commandSet.get(token, -1);
++      }
++  
++!     public static HashSet keywords;
++      static IntValueHashMap valueTokens;
++  
++      static {
++diff -crN hsqldb-old/src/org/hsqldb/Trace.java hsqldb/src/org/hsqldb/Trace.java
++*** hsqldb-old/src/org/hsqldb/Trace.java	2007-10-16 08:56:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/Trace.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 709,715 ****
++      /**
++       * Returns the stack trace for doAssert()
++       */
++!     private static String getStackTrace() {
++  
++          try {
++              Exception e = new Exception();
++--- 709,715 ----
++      /**
++       * Returns the stack trace for doAssert()
++       */
++!     public static String getStackTrace() {
++  
++          try {
++              Exception e = new Exception();
++diff -crN hsqldb-old/src/org/hsqldb/TransactionManager.java hsqldb/src/org/hsqldb/TransactionManager.java
++*** hsqldb-old/src/org/hsqldb/TransactionManager.java	2005-11-19 19:20:52.000000000 +0100
++--- hsqldb/src/org/hsqldb/TransactionManager.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 169,175 ****
++          }
++      }
++  
++!     private long globalActionTimestamp = 0;
++  
++      /**
++       * gets the next timestamp for an action
++--- 169,175 ----
++          }
++      }
++  
++!     public long globalActionTimestamp = 0;
++  
++      /**
++       * gets the next timestamp for an action
++diff -crN hsqldb-old/src/org/hsqldb/TriggerDef.java hsqldb/src/org/hsqldb/TriggerDef.java
++*** hsqldb-old/src/org/hsqldb/TriggerDef.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/TriggerDef.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 84,100 ****
++          return defaultQueueSize;
++      }
++  
++!     protected static int defaultQueueSize = 1024;
++      Table                table;
++      Trigger              trigger;
++      String               triggerClassName;
++      int                  vectorIndex;               // index into HsqlArrayList[]
++  
++!     //protected boolean busy;               // firing trigger in progress
++!     protected HsqlDeque        pendingQueue;        // row triggers pending
++!     protected int              rowsQueued;          // rows in pendingQueue
++!     protected boolean          valid     = true;    // parsing valid
++!     protected volatile boolean keepGoing = true;
++  
++      /**
++       *  Constructs a new TriggerDef object to represent an HSQLDB trigger
++--- 84,100 ----
++          return defaultQueueSize;
++      }
++  
++!     public static int defaultQueueSize = 1024;
++      Table                table;
++      Trigger              trigger;
++      String               triggerClassName;
++      int                  vectorIndex;               // index into HsqlArrayList[]
++  
++!     //public boolean busy;               // firing trigger in progress
++!     public HsqlDeque        pendingQueue;        // row triggers pending
++!     public int              rowsQueued;          // rows in pendingQueue
++!     public boolean          valid     = true;    // parsing valid
++!     public volatile boolean keepGoing = true;
++  
++      /**
++       *  Constructs a new TriggerDef object to represent an HSQLDB trigger
++diff -crN hsqldb-old/src/org/hsqldb/types/Binary.java hsqldb/src/org/hsqldb/types/Binary.java
++*** hsqldb-old/src/org/hsqldb/types/Binary.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/types/Binary.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 46,52 ****
++   */
++  public class Binary {
++  
++!     private byte[] data;
++      int            hash;
++  
++      /**
++--- 46,52 ----
++   */
++  public class Binary {
++  
++!     public byte[] data;
++      int            hash;
++  
++      /**
++diff -crN hsqldb-old/src/org/hsqldb/types/JavaObject.java hsqldb/src/org/hsqldb/types/JavaObject.java
++*** hsqldb-old/src/org/hsqldb/types/JavaObject.java	2005-10-23 21:25:12.000000000 +0200
++--- hsqldb/src/org/hsqldb/types/JavaObject.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 65,71 ****
++   */
++  public class JavaObject {
++  
++!     private byte[] data;
++  
++      /**
++       * Constructor used inside the engine when an already serialized
++--- 65,71 ----
++   */
++  public class JavaObject {
++  
++!     public byte[] data;
++  
++      /**
++       * Constructor used inside the engine when an already serialized
++diff -crN hsqldb-old/src/org/hsqldb/Types.java hsqldb/src/org/hsqldb/Types.java
++*** hsqldb-old/src/org/hsqldb/Types.java	2007-06-11 12:12:30.000000000 +0200
++--- hsqldb/src/org/hsqldb/Types.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 463,469 ****
++  //                   number class is
++  //                   narrower than the corresponding internal
++  //                   wrapper
++!     private static org.hsqldb.lib.HashSet illegalParameterClasses;
++  
++      static {
++          typeAliases = new IntValueHashMap(50);
++--- 463,469 ----
++  //                   number class is
++  //                   narrower than the corresponding internal
++  //                   wrapper
++!     public static org.hsqldb.lib.HashSet illegalParameterClasses;
++  
++      static {
++          typeAliases = new IntValueHashMap(50);
++***************
++*** 1113,1119 ****
++      //
++      // 1.) refusing to directly display such columns in graphical query results
++      // 2.) providing other means to retrieve and display such values
++!     private static int MAX_CHAR_OR_VARCHAR_DISPLAY_SIZE() {
++  
++          try {
++              return Integer.getInteger(
++--- 1113,1119 ----
++      //
++      // 1.) refusing to directly display such columns in graphical query results
++      // 2.) providing other means to retrieve and display such values
++!     public static int MAX_CHAR_OR_VARCHAR_DISPLAY_SIZE() {
++  
++          try {
++              return Integer.getInteger(
++diff -crN hsqldb-old/src/org/hsqldb/User.java hsqldb/src/org/hsqldb/User.java
++*** hsqldb-old/src/org/hsqldb/User.java	2006-04-11 17:13:22.000000000 +0200
++--- hsqldb/src/org/hsqldb/User.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 91,112 ****
++  public class User {
++  
++      /** true if this user is the sys user. */
++!     private boolean isSys;
++  
++      /** true if this user is the public user. */
++!     private boolean isPublic;
++  
++      /** user name. */
++!     private String sName;
++  
++      /** password. */
++!     private String sPassword;
++  
++      /** default schema when new Sessions started (defaults to PUBLIC schema) */
++!     private HsqlName initialSchema = null;
++  
++      /** grantee object. */
++!     private Grantee grantee;
++  
++      /**
++       * Constructor
++--- 91,112 ----
++  public class User {
++  
++      /** true if this user is the sys user. */
++!     public boolean isSys;
++  
++      /** true if this user is the public user. */
++!     public boolean isPublic;
++  
++      /** user name. */
++!     public String sName;
++  
++      /** password. */
++!     public String sPassword;
++  
++      /** default schema when new Sessions started (defaults to PUBLIC schema) */
++!     public HsqlName initialSchema = null;
++  
++      /** grantee object. */
++!     public Grantee grantee;
++  
++      /**
++       * Constructor
++diff -crN hsqldb-old/src/org/hsqldb/UserManager.java hsqldb/src/org/hsqldb/UserManager.java
++*** hsqldb-old/src/org/hsqldb/UserManager.java	2006-04-11 17:13:22.000000000 +0200
++--- hsqldb/src/org/hsqldb/UserManager.java	2007-11-04 00:14:04.000000000 +0100
++***************
++*** 112,119 ****
++       * User object is kept in the list because it's needed by MetaData
++       * routines via "listVisibleUsers(x, true)".
++       */
++!     private HashMappedList userList;
++!     private GranteeManager granteeManager;
++  
++      /**
++       * Construction happens once for each Database object.
++--- 112,119 ----
++       * User object is kept in the list because it's needed by MetaData
++       * routines via "listVisibleUsers(x, true)".
++       */
++!     public HashMappedList userList;
++!     public GranteeManager granteeManager;
++  
++      /**
++       * Construction happens once for each Database object.
++diff -crN hsqldb-old/src/org/hsqldb/util/CodeSwitcher.java hsqldb/src/org/hsqldb/util/CodeSwitcher.java
++*** hsqldb-old/src/org/hsqldb/util/CodeSwitcher.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/CodeSwitcher.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 109,121 ****
++   */
++  public class CodeSwitcher {
++  
++!     private static final String ls = System.getProperty("line.separator",
++          "\n");
++!     private Vector           vList;
++!     private Vector           vSwitchOn;
++!     private Vector           vSwitchOff;
++!     private Vector           vSwitches;
++!     private static final int MAX_LINELENGTH = 82;
++  
++      /**
++       * Method declaration
++--- 109,121 ----
++   */
++  public class CodeSwitcher {
++  
++!     public static final String ls = System.getProperty("line.separator",
++          "\n");
++!     public Vector           vList;
++!     public Vector           vSwitchOn;
++!     public Vector           vSwitchOff;
++!     public Vector           vSwitches;
++!     public static final int MAX_LINELENGTH = 82;
++  
++      /**
++       * Method declaration
++diff -crN hsqldb-old/src/org/hsqldb/util/CommonSwing.java hsqldb/src/org/hsqldb/util/CommonSwing.java
++*** hsqldb-old/src/org/hsqldb/util/CommonSwing.java	2006-02-16 04:48:00.000000000 +0100
++--- hsqldb/src/org/hsqldb/util/CommonSwing.java	2007-11-04 00:13:47.000000000 +0100
++***************
++*** 57,68 ****
++   */
++  class CommonSwing {
++  
++!     protected static String messagerHeader = "Database Manager Swing Error";
++!     protected static String Native         = "Native";
++!     protected static String Java           = "Java";
++!     protected static String Motif          = "Motif";
++!     protected static String plaf           = "plaf";
++!     protected static String GTK            = "GTK";
++  
++      // (ulrivo): An actual Image.
++      static Image getIcon(String target) {
++--- 57,68 ----
++   */
++  class CommonSwing {
++  
++!     public static String messagerHeader = "Database Manager Swing Error";
++!     public static String Native         = "Native";
++!     public static String Java           = "Java";
++!     public static String Motif          = "Motif";
++!     public static String plaf           = "plaf";
++!     public static String GTK            = "GTK";
++  
++      // (ulrivo): An actual Image.
++      static Image getIcon(String target) {
++***************
++*** 106,112 ****
++      }
++  
++      // (weconsultants@users: Callable errorMessage method
++!     protected static void errorMessage(String errorMessage) {
++  
++          /**
++           * Display Jpanel Error messages any text Errors. Overloads
++--- 106,112 ----
++      }
++  
++      // (weconsultants@users: Callable errorMessage method
++!     public static void errorMessage(String errorMessage) {
++  
++          /**
++           * Display Jpanel Error messages any text Errors. Overloads
++diff -crN hsqldb-old/src/org/hsqldb/util/ConnectionDialogCommon.java hsqldb/src/org/hsqldb/util/ConnectionDialogCommon.java
++*** hsqldb-old/src/org/hsqldb/util/ConnectionDialogCommon.java	2007-10-19 22:16:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ConnectionDialogCommon.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 59,66 ****
++   */
++  class ConnectionDialogCommon {
++  
++!     private static String[][]       connTypes;
++!     private static final String[][] sJDBCTypes = {
++          {
++              "HSQL Database Engine In-Memory", "org.hsqldb.jdbcDriver",
++              "jdbc:hsqldb:mem:."
++--- 59,66 ----
++   */
++  class ConnectionDialogCommon {
++  
++!     public static String[][]       connTypes;
++!     public static final String[][] sJDBCTypes = {
++          {
++              "HSQL Database Engine In-Memory", "org.hsqldb.jdbcDriver",
++              "jdbc:hsqldb:mem:."
++***************
++*** 159,166 ****
++   */
++      }
++  
++!     private static final String fileName       = "hsqlprefs.dat";
++!     private static File         recentSettings = null;
++  
++      static Hashtable loadRecentConnectionSettings() throws IOException {
++  
++--- 159,166 ----
++   */
++      }
++  
++!     public static final String fileName       = "hsqlprefs.dat";
++!     public static File         recentSettings = null;
++  
++      static Hashtable loadRecentConnectionSettings() throws IOException {
++  
++***************
++*** 245,251 ****
++       * @param settings ConnectionSetting[]
++       * @throw IOException if something goes wrong while writing
++       */
++!     private static void storeRecentConnectionSettings(Hashtable settings) {
++  
++          try {
++              if (recentSettings == null) {
++--- 245,251 ----
++       * @param settings ConnectionSetting[]
++       * @throw IOException if something goes wrong while writing
++       */
++!     public static void storeRecentConnectionSettings(Hashtable settings) {
++  
++          try {
++              if (recentSettings == null) {
++***************
++*** 310,316 ****
++          } catch (Throwable t) {}
++      }
++  
++!     private static String homedir = null;
++  
++      public static void setHomeDir() {
++  
++--- 310,316 ----
++          } catch (Throwable t) {}
++      }
++  
++!     public static String homedir = null;
++  
++      public static void setHomeDir() {
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/ConnectionDialog.java hsqldb/src/org/hsqldb/util/ConnectionDialog.java
++*** hsqldb-old/src/org/hsqldb/util/ConnectionDialog.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ConnectionDialog.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 67,78 ****
++  class ConnectionDialog extends Dialog
++  implements ActionListener, ItemListener {
++  
++!     protected Connection mConnection;
++!     protected TextField  mName, mDriver, mURL, mUser, mPassword;
++!     protected Label      mError;
++!     private String[][]   connTypes;
++!     private Hashtable    settings;
++!     private Choice       types, recent;
++  
++      /**
++       * Method declaration
++--- 67,78 ----
++  class ConnectionDialog extends Dialog
++  implements ActionListener, ItemListener {
++  
++!     public Connection mConnection;
++!     public TextField  mName, mDriver, mURL, mUser, mPassword;
++!     public Label      mError;
++!     public String[][]   connTypes;
++!     public Hashtable    settings;
++!     public Choice       types, recent;
++  
++      /**
++       * Method declaration
++***************
++*** 110,116 ****
++       * Method declaration
++       *
++       */
++!     private void create() {
++  
++          Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
++  
++--- 110,116 ----
++       * Method declaration
++       *
++       */
++!     public void create() {
++  
++          Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
++  
++***************
++*** 305,311 ****
++       *
++       * @return
++       */
++!     protected static Label createLabel(String s) {
++  
++          Label l = new Label(s);
++  
++--- 305,311 ----
++       *
++       * @return
++       */
++!     public static Label createLabel(String s) {
++  
++          Label l = new Label(s);
++  
++***************
++*** 322,328 ****
++       *
++       * @return
++       */
++!     protected static Panel createBorderPanel(Component center) {
++  
++          Panel p = new Panel();
++  
++--- 322,328 ----
++       *
++       * @return
++       */
++!     public static Panel createBorderPanel(Component center) {
++  
++          Panel p = new Panel();
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/ConnectionDialogSwing.java hsqldb/src/org/hsqldb/util/ConnectionDialogSwing.java
++*** hsqldb-old/src/org/hsqldb/util/ConnectionDialogSwing.java	2006-02-16 04:48:00.000000000 +0100
++--- hsqldb/src/org/hsqldb/util/ConnectionDialogSwing.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 82,97 ****
++      /**
++       * Comment for <code>serialVersionUID</code>
++       */
++!     private static final long serialVersionUID = 1L;
++!     private Connection        mConnection;
++!     private JTextField        mName, mDriver, mURL, mUser;
++!     private JPasswordField    mPassword;
++!     private String[][]        connTypes;
++!     private Hashtable         settings;
++!     private JButton           okCancel, clear;
++!     private JComboBox mSettingName =
++          new JComboBox(loadRecentConnectionSettings());
++!     private static ConnectionSetting currentConnectionSetting = null;
++  
++      public static void setConnectionSetting(
++              ConnectionSetting connectionSetting) {
++--- 82,97 ----
++      /**
++       * Comment for <code>serialVersionUID</code>
++       */
++!     public static final long serialVersionUID = 1L;
++!     public Connection        mConnection;
++!     public JTextField        mName, mDriver, mURL, mUser;
++!     public JPasswordField    mPassword;
++!     public String[][]        connTypes;
++!     public Hashtable         settings;
++!     public JButton           okCancel, clear;
++!     public JComboBox mSettingName =
++          new JComboBox(loadRecentConnectionSettings());
++!     public static ConnectionSetting currentConnectionSetting = null;
++  
++      public static void setConnectionSetting(
++              ConnectionSetting connectionSetting) {
++***************
++*** 110,116 ****
++          super(owner, title, true);
++      }
++  
++!     private void create() {
++  
++          Box main     = Box.createHorizontalBox();
++          Box labels   = Box.createVerticalBox();
++--- 110,116 ----
++          super(owner, title, true);
++      }
++  
++!     public void create() {
++  
++          Box main     = Box.createHorizontalBox();
++          Box labels   = Box.createVerticalBox();
++***************
++*** 285,291 ****
++          return dialog.mConnection;
++      }
++  
++!     private static JLabel createLabel(String s) {
++  
++          JLabel l = new JLabel(s);
++  
++--- 285,291 ----
++          return dialog.mConnection;
++      }
++  
++!     public static JLabel createLabel(String s) {
++  
++          JLabel l = new JLabel(s);
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/ConnectionSetting.java hsqldb/src/org/hsqldb/util/ConnectionSetting.java
++*** hsqldb-old/src/org/hsqldb/util/ConnectionSetting.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ConnectionSetting.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 39,45 ****
++   */
++  public class ConnectionSetting implements java.io.Serializable {
++  
++!     private String name, driver, url, user, pw;
++  
++      String getName() {
++          return name;
++--- 39,45 ----
++   */
++  public class ConnectionSetting implements java.io.Serializable {
++  
++!     public String name, driver, url, user, pw;
++  
++      String getName() {
++          return name;
++***************
++*** 62,68 ****
++      }
++  
++      // Constructors
++!     private ConnectionSetting() {}
++      ;
++  
++      ConnectionSetting(String name, String driver, String url, String user,
++--- 62,68 ----
++      }
++  
++      // Constructors
++!     public ConnectionSetting() {}
++      ;
++  
++      ConnectionSetting(String name, String driver, String url, String user,
++diff -crN hsqldb-old/src/org/hsqldb/util/CSVWriter.java hsqldb/src/org/hsqldb/util/CSVWriter.java
++*** hsqldb-old/src/org/hsqldb/util/CSVWriter.java	2007-06-11 12:12:32.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/CSVWriter.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 49,58 ****
++   */
++  public class CSVWriter {
++  
++!     private String             newline = System.getProperty("line.separator");
++!     private OutputStreamWriter writer  = null;
++!     private int                nbrCols = 0;
++!     private int                nbrRows = 0;
++  
++      /**
++       * constructor.
++--- 49,58 ----
++   */
++  public class CSVWriter {
++  
++!     public String             newline = System.getProperty("line.separator");
++!     public OutputStreamWriter writer  = null;
++!     public int                nbrCols = 0;
++!     public int                nbrRows = 0;
++  
++      /**
++       * constructor.
++***************
++*** 100,106 ****
++          this.writer.close();
++      }
++  
++!     private void doWriteData(String[] values) throws IOException {
++  
++          for (int i = 0; i < values.length; i++) {
++              if (i > 0) {
++--- 100,106 ----
++          this.writer.close();
++      }
++  
++!     public void doWriteData(String[] values) throws IOException {
++  
++          for (int i = 0; i < values.length; i++) {
++              if (i > 0) {
++***************
++*** 119,125 ****
++          this.nbrRows++;
++      }
++  
++!     private String toCsvValue(String str) {
++  
++          StringBuffer sb = new StringBuffer();
++  
++--- 119,125 ----
++          this.nbrRows++;
++      }
++  
++!     public String toCsvValue(String str) {
++  
++          StringBuffer sb = new StringBuffer();
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/DatabaseManagerCommon.java hsqldb/src/org/hsqldb/util/DatabaseManagerCommon.java
++*** hsqldb-old/src/org/hsqldb/util/DatabaseManagerCommon.java	2007-10-19 22:16:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/DatabaseManagerCommon.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 92,98 ****
++   */
++  class DatabaseManagerCommon {
++  
++!     private static Random rRandom    = new Random(100);
++      static String[]       selectHelp = {
++          "SELECT * FROM ",
++  
++--- 92,98 ----
++   */
++  class DatabaseManagerCommon {
++  
++!     public static Random rRandom    = new Random(100);
++      static String[]       selectHelp = {
++          "SELECT * FROM ",
++  
++***************
++*** 420,424 ****
++          return (System.currentTimeMillis() - start);
++      }
++  
++!     private DatabaseManagerCommon() {}
++  }
++--- 420,424 ----
++          return (System.currentTimeMillis() - start);
++      }
++  
++!     public DatabaseManagerCommon() {}
++  }
++diff -crN hsqldb-old/src/org/hsqldb/util/DatabaseManager.java hsqldb/src/org/hsqldb/util/DatabaseManager.java
++*** hsqldb-old/src/org/hsqldb/util/DatabaseManager.java	2007-10-19 22:16:42.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/DatabaseManager.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 98,108 ****
++  public class DatabaseManager extends Applet
++  implements ActionListener, WindowListener, KeyListener {
++  
++!     private static final String DEFAULT_RCFILE =
++          System.getProperty("user.home") + "/dbmanager.rc";
++      static final String    NL           = System.getProperty("line.separator");
++      static final int       iMaxRecent   = 24;
++!     private static boolean TT_AVAILABLE = false;
++  
++      static {
++          try {
++--- 98,108 ----
++  public class DatabaseManager extends Applet
++  implements ActionListener, WindowListener, KeyListener {
++  
++!     public static final String DEFAULT_RCFILE =
++          System.getProperty("user.home") + "/dbmanager.rc";
++      static final String    NL           = System.getProperty("line.separator");
++      static final int       iMaxRecent   = 24;
++!     public static boolean TT_AVAILABLE = false;
++  
++      static {
++          try {
++***************
++*** 113,119 ****
++          } catch (Throwable t) {}
++      }
++  
++!     private static final String HELP_TEXT =
++          "See the forums, mailing lists, and HSQLDB User Guide\n"
++          + "at http://hsqldb.org.\n\n"
++          + "Please paste the following version identifier with any\n"
++--- 113,119 ----
++          } catch (Throwable t) {}
++      }
++  
++!     public static final String HELP_TEXT =
++          "See the forums, mailing lists, and HSQLDB User Guide\n"
++          + "at http://hsqldb.org.\n\n"
++          + "Please paste the following version identifier with any\n"
++***************
++*** 122,128 ****
++                          : ("\n\nTransferTool classes are not in CLASSPATH.\n"
++                             + "To enable the Tools menu, add 'transfer.jar' to your class path."));
++      ;
++!     private static final String ABOUT_TEXT =
++          "$Revision: 1.34 $ of DatabaseManagerSwing\n\n"
++          + "Copyright (c) 1995-2000, The Hypersonic SQL Group.\n"
++          + "Copyright (c) 2001-2007, The HSQL Development Group.\n"
++--- 122,128 ----
++                          : ("\n\nTransferTool classes are not in CLASSPATH.\n"
++                             + "To enable the Tools menu, add 'transfer.jar' to your class path."));
++      ;
++!     public static final String ABOUT_TEXT =
++          "$Revision: 1.34 $ of DatabaseManagerSwing\n\n"
++          + "Copyright (c) 1995-2000, The Hypersonic SQL Group.\n"
++          + "Copyright (c) 2001-2007, The HSQL Development Group.\n"
++***************
++*** 322,328 ****
++          m.connect(c);
++      }
++  
++!     private static void showUsage() {
++  
++          System.out.println(
++              "Usage: java DatabaseManager [--options]\n"
++--- 322,328 ----
++          m.connect(c);
++      }
++  
++!     public static void showUsage() {
++  
++          System.out.println(
++              "Usage: java DatabaseManager [--options]\n"
++***************
++*** 1221,1227 ****
++       *
++       * @param s
++       */
++!     private void addToRecent(String s) {
++  
++          for (int i = 0; i < iMaxRecent; i++) {
++              if (s.equals(sRecent[i])) {
++--- 1221,1227 ----
++       *
++       * @param s
++       */
++!     public void addToRecent(String s) {
++  
++          for (int i = 0; i < iMaxRecent; i++) {
++              if (s.equals(sRecent[i])) {
++***************
++*** 1252,1258 ****
++       * Method declaration
++       *
++       */
++!     private void initGUI() {
++  
++          Panel pQuery   = new Panel();
++          Panel pCommand = new Panel();
++--- 1252,1258 ----
++       * Method declaration
++       *
++       */
++!     public void initGUI() {
++  
++          Panel pQuery   = new Panel();
++          Panel pCommand = new Panel();
++***************
++*** 1312,1318 ****
++       * Method declaration
++       *
++       */
++!     protected void refreshTree() {
++  
++          tTree.removeAll();
++  
++--- 1312,1318 ----
++       * Method declaration
++       *
++       */
++!     public void refreshTree() {
++  
++          tTree.removeAll();
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/DatabaseManagerSwing.java hsqldb/src/org/hsqldb/util/DatabaseManagerSwing.java
++*** hsqldb-old/src/org/hsqldb/util/DatabaseManagerSwing.java	2007-10-19 22:16:44.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/DatabaseManagerSwing.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 195,202 ****
++       * be reserved for single-letter switches which can be mixed like
++       * "-u -r -l" = "-url".  -blaine
++       */
++!     private static String homedir = null;
++!     private boolean isOracle = false; // Need some workarounds for Oracle
++  
++      static {
++          try {
++--- 195,202 ----
++       * be reserved for single-letter switches which can be mixed like
++       * "-u -r -l" = "-url".  -blaine
++       */
++!     public static String homedir = null;
++!     public boolean isOracle = false; // Need some workarounds for Oracle
++  
++      static {
++          try {
++***************
++*** 242,250 ****
++      }
++  
++      ArrayList                   localActionList = new ArrayList();
++!     private JFrame              jframe          = null;
++!     private static final String DEFAULT_RCFILE  = homedir + "/dbmanager.rc";
++!     private static boolean      TT_AVAILABLE    = false;
++  
++      static {
++          try {
++--- 242,250 ----
++      }
++  
++      ArrayList                   localActionList = new ArrayList();
++!     public JFrame              jframe          = null;
++!     public static final String DEFAULT_RCFILE  = homedir + "/dbmanager.rc";
++!     public static boolean      TT_AVAILABLE    = false;
++  
++      static {
++          try {
++***************
++*** 261,267 ****
++          }
++      }
++  
++!     private static final String HELP_TEXT =
++          "See the forums, mailing lists, and HSQLDB User Guide\n"
++          + "at http://hsqldb.org.\n\n"
++          + "Please paste the following version identifier with any\n"
++--- 261,267 ----
++          }
++      }
++  
++!     public static final String HELP_TEXT =
++          "See the forums, mailing lists, and HSQLDB User Guide\n"
++          + "at http://hsqldb.org.\n\n"
++          + "Please paste the following version identifier with any\n"
++***************
++*** 271,277 ****
++                             + "To enable the Tools menu, add 'transfer.jar' "
++                             + "to your class path."));
++      ;
++!     private static final String ABOUT_TEXT =
++          "$Revision: 1.77 $ of DatabaseManagerSwing\n\n"
++          + "Copyright (c) 1995-2000, The Hypersonic SQL Group.\n"
++          + "Copyright (c) 2001-2007, The HSQL Development Group.\n"
++--- 271,277 ----
++                             + "To enable the Tools menu, add 'transfer.jar' "
++                             + "to your class path."));
++      ;
++!     public static final String ABOUT_TEXT =
++          "$Revision: 1.77 $ of DatabaseManagerSwing\n\n"
++          + "Copyright (c) 1995-2000, The Hypersonic SQL Group.\n"
++          + "Copyright (c) 2001-2007, The HSQL Development Group.\n"
++***************
++*** 324,333 ****
++      /** Value of this variable only retained if huge input script read in. */
++      String          sqlScriptBuffer = null;
++      JToolBar        jtoolbar;
++!     private boolean showSchemas  = true;
++!     private boolean showTooltips = true;
++!     private boolean autoRefresh  = true;
++!     private boolean gridFormat   = true;
++  
++      // Added: (weconsultants@users)
++      static DatabaseManagerSwing refForFontDialogSwing;
++--- 324,333 ----
++      /** Value of this variable only retained if huge input script read in. */
++      String          sqlScriptBuffer = null;
++      JToolBar        jtoolbar;
++!     public boolean showSchemas  = true;
++!     public boolean showTooltips = true;
++!     public boolean autoRefresh  = true;
++!     public boolean gridFormat   = true;
++  
++      // Added: (weconsultants@users)
++      static DatabaseManagerSwing refForFontDialogSwing;
++***************
++*** 362,375 ****
++          new JRadioButtonMenuItem("Motif Look & Feel");
++      JLabel                      jStatusLine;
++      static String               READY_STATUS         = "Ready";
++!     private static final String AUTOCOMMIT_BOX_TEXT  = "Autocommit mode";
++!     private static final String LOGGING_BOX_TEXT     = "Logging mode";
++!     private static final String SHOWSCHEMAS_BOX_TEXT = "Show schemas";
++!     private static final String AUTOREFRESH_BOX_TEXT = "Auto-refresh tree";
++!     private static final String SHOWTIPS_BOX_TEXT    = "Show Tooltips";
++!     private static final String ROWCOUNTS_BOX_TEXT   = "Show row counts";
++!     private static final String SHOWSYS_BOX_TEXT     = "Show system tables";
++!     private static final String GRID_BOX_TEXT =
++          "Show results in Grid (a.o.t. Text)";
++  
++      // variables to hold the default cursors for these top level swing objects
++--- 362,375 ----
++          new JRadioButtonMenuItem("Motif Look & Feel");
++      JLabel                      jStatusLine;
++      static String               READY_STATUS         = "Ready";
++!     public static final String AUTOCOMMIT_BOX_TEXT  = "Autocommit mode";
++!     public static final String LOGGING_BOX_TEXT     = "Logging mode";
++!     public static final String SHOWSCHEMAS_BOX_TEXT = "Show schemas";
++!     public static final String AUTOREFRESH_BOX_TEXT = "Auto-refresh tree";
++!     public static final String SHOWTIPS_BOX_TEXT    = "Show Tooltips";
++!     public static final String ROWCOUNTS_BOX_TEXT   = "Show row counts";
++!     public static final String SHOWSYS_BOX_TEXT     = "Show system tables";
++!     public static final String GRID_BOX_TEXT =
++          "Show results in Grid (a.o.t. Text)";
++  
++      // variables to hold the default cursors for these top level swing objects
++***************
++*** 378,391 ****
++      Cursor        txtCommandCursor;
++      Cursor        txtResultCursor;
++      HashMap       tipMap     = new HashMap();
++!     private JMenu mnuSchemas = new JMenu("Schemas");
++  
++      /**
++       * Wait Cursor
++       */
++  
++      // Changed: (weconsultants@users): commonted out the, out of the box, cursor to use a custom cursor
++!     private final Cursor waitCursor = new Cursor(Cursor.WAIT_CURSOR);
++  
++      //getToolkit().createCustomCursor(CommonSwing.getIcon("SystemCursor"),
++      //                                new Point(4, 4), "HourGlass cursor");
++--- 378,391 ----
++      Cursor        txtCommandCursor;
++      Cursor        txtResultCursor;
++      HashMap       tipMap     = new HashMap();
++!     public JMenu mnuSchemas = new JMenu("Schemas");
++  
++      /**
++       * Wait Cursor
++       */
++  
++      // Changed: (weconsultants@users): commonted out the, out of the box, cursor to use a custom cursor
++!     public final Cursor waitCursor = new Cursor(Cursor.WAIT_CURSOR);
++  
++      //getToolkit().createCustomCursor(CommonSwing.getIcon("SystemCursor"),
++      //                                new Point(4, 4), "HourGlass cursor");
++***************
++*** 396,402 ****
++      static String  defPassword = "";
++      static String  defScript;
++      static String  defDirectory;
++!     private String schemaFilter = null;
++  
++      public DatabaseManagerSwing() {
++          jframe = new JFrame("HSQLDB DatabaseManager");
++--- 396,402 ----
++      static String  defPassword = "";
++      static String  defScript;
++      static String  defDirectory;
++!     public String schemaFilter = null;
++  
++      public DatabaseManagerSwing() {
++          jframe = new JFrame("HSQLDB DatabaseManager");
++***************
++*** 671,677 ****
++          }
++      }
++  
++!     private static void showUsage() {
++  
++          System.out.println(
++              "Usage: java DatabaseManagerSwing [--options]\n"
++--- 671,677 ----
++          }
++      }
++  
++!     public static void showUsage() {
++  
++          System.out.println(
++              "Usage: java DatabaseManagerSwing [--options]\n"
++***************
++*** 688,694 ****
++              + "(Single-hypen switches like '-driver' are also supported)");
++      }
++  
++!     private void insertTestData() {
++  
++          try {
++              DatabaseManagerCommon.createTestTables(sStatement);
++--- 688,694 ----
++              + "(Single-hypen switches like '-driver' are also supported)");
++      }
++  
++!     public void insertTestData() {
++  
++          try {
++              DatabaseManagerCommon.createTestTables(sStatement);
++***************
++*** 712,718 ****
++          this.bMustExit = b;
++      }
++  
++!     private DBMPrefs prefs = null;
++  
++      public void main() {
++  
++--- 712,718 ----
++          this.bMustExit = b;
++      }
++  
++!     public DBMPrefs prefs = null;
++  
++      public void main() {
++  
++***************
++*** 986,992 ****
++          txtCommand.requestFocus();
++      }
++  
++!     private JMenu addMenu(JMenuBar b, String name, Object[] items) {
++  
++          JMenu menu = new JMenu(name);
++  
++--- 986,992 ----
++          txtCommand.requestFocus();
++      }
++  
++!     public JMenu addMenu(JMenuBar b, String name, Object[] items) {
++  
++          JMenu menu = new JMenu(name);
++  
++***************
++*** 997,1003 ****
++          return menu;
++      }
++  
++!     private void addMenuItems(JMenu f, Object[] m) {
++  
++          /*
++           * This method needs to be completely written or just
++--- 997,1003 ----
++          return menu;
++      }
++  
++!     public void addMenuItems(JMenu f, Object[] m) {
++  
++          /*
++           * This method needs to be completely written or just
++***************
++*** 1328,1334 ****
++          }
++      }
++  
++!     private void displayResults() {
++  
++          if (gridFormat) {
++              setResultsInGrid();
++--- 1328,1334 ----
++          }
++      }
++  
++!     public void displayResults() {
++  
++          if (gridFormat) {
++              setResultsInGrid();
++***************
++*** 1337,1343 ****
++          }
++      }
++  
++!     private void setResultsInGrid() {
++  
++          pResult.removeAll();
++          pResult.add(gScrollPane, BorderLayout.CENTER);
++--- 1337,1343 ----
++          }
++      }
++  
++!     public void setResultsInGrid() {
++  
++          pResult.removeAll();
++          pResult.add(gScrollPane, BorderLayout.CENTER);
++***************
++*** 1346,1352 ****
++          pResult.repaint();
++      }
++  
++!     private void setResultsInText() {
++  
++          pResult.removeAll();
++          pResult.add(txtResultScroll, BorderLayout.CENTER);
++--- 1346,1352 ----
++          pResult.repaint();
++      }
++  
++!     public void setResultsInText() {
++  
++          pResult.removeAll();
++          pResult.add(txtResultScroll, BorderLayout.CENTER);
++***************
++*** 1355,1361 ****
++          pResult.repaint();
++      }
++  
++!     private void showHelp(String[] help) {
++  
++          txtCommand.setText(help[0]);
++  
++--- 1355,1361 ----
++          pResult.repaint();
++      }
++  
++!     public void showHelp(String[] help) {
++  
++          txtCommand.setText(help[0]);
++  
++***************
++*** 1417,1423 ****
++          }
++      }
++  
++!     private void clear() {
++  
++          sqlScriptBuffer = null;
++  
++--- 1417,1423 ----
++          }
++      }
++  
++!     public void clear() {
++  
++          sqlScriptBuffer = null;
++  
++***************
++*** 1425,1433 ****
++          txtCommand.setEnabled(true);
++      }
++  
++!     private String busyText = null;
++  
++!     private void backgroundIt(Runnable r, String description) {
++  
++          if (busyText != null) {
++              Toolkit.getDefaultToolkit().beep();
++--- 1425,1433 ----
++          txtCommand.setEnabled(true);
++      }
++  
++!     public String busyText = null;
++  
++!     public void backgroundIt(Runnable r, String description) {
++  
++          if (busyText != null) {
++              Toolkit.getDefaultToolkit().beep();
++***************
++*** 1441,1447 ****
++          SwingUtilities.invokeLater(r);
++      }
++  
++!     private void clearResultPanel() {
++  
++          gResult.setHead(new Object[0]);
++          gResult.clear();
++--- 1441,1447 ----
++          SwingUtilities.invokeLater(r);
++      }
++  
++!     public void clearResultPanel() {
++  
++          gResult.setHead(new Object[0]);
++          gResult.clear();
++***************
++*** 1498,1520 ****
++                                                      : 0));
++      }
++  
++!     private Runnable enableButtonRunnable = new Runnable() {
++  
++          public void run() {
++              jbuttonClear.setEnabled(true);
++              jbuttonExecute.setEnabled(true);
++          }
++      };
++!     private Runnable disableButtonRunnable = new Runnable() {
++  
++          public void run() {
++              jbuttonClear.setEnabled(false);
++              jbuttonExecute.setEnabled(false);
++          }
++      };
++!     private Thread           buttonUpdaterThread = null;
++!     private static final int BUTTON_CHECK_PERIOD = 500;
++!     private Runnable         buttonUpdater       = new Runnable() {
++  
++          public void run() {
++  
++--- 1498,1520 ----
++                                                      : 0));
++      }
++  
++!     public Runnable enableButtonRunnable = new Runnable() {
++  
++          public void run() {
++              jbuttonClear.setEnabled(true);
++              jbuttonExecute.setEnabled(true);
++          }
++      };
++!     public Runnable disableButtonRunnable = new Runnable() {
++  
++          public void run() {
++              jbuttonClear.setEnabled(false);
++              jbuttonExecute.setEnabled(false);
++          }
++      };
++!     public Thread           buttonUpdaterThread = null;
++!     public static final int BUTTON_CHECK_PERIOD = 500;
++!     public Runnable         buttonUpdater       = new Runnable() {
++  
++          public void run() {
++  
++***************
++*** 1538,1545 ****
++              }
++          }
++      };
++!     private JButton jbuttonClear;
++!     private JButton jbuttonExecute;
++  
++      public void start() {
++  
++--- 1538,1545 ----
++              }
++          }
++      };
++!     public JButton jbuttonClear;
++!     public JButton jbuttonExecute;
++  
++      public void start() {
++  
++***************
++*** 1557,1563 ****
++          buttonUpdaterThread = null;
++      }
++  
++!     private Runnable treeRefreshRunnable = new Runnable() {
++  
++          public void run() {
++  
++--- 1557,1563 ----
++          buttonUpdaterThread = null;
++      }
++  
++!     public Runnable treeRefreshRunnable = new Runnable() {
++  
++          public void run() {
++  
++***************
++*** 1576,1582 ****
++      /**
++       * Schedules to run in a Gui-safe thread
++       */
++!     protected void executeCurrentSQL() {
++  
++          if (txtCommand.getText().length() < 1) {
++              CommonSwing.errorMessage("No SQL to execute");
++--- 1576,1582 ----
++      /**
++       * Schedules to run in a Gui-safe thread
++       */
++!     public void executeCurrentSQL() {
++  
++          if (txtCommand.getText().length() < 1) {
++              CommonSwing.errorMessage("No SQL to execute");
++***************
++*** 1587,1593 ****
++          backgroundIt(new StatementExecRunnable(), "Executing SQL");
++      }
++  
++!     protected class StatementExecRunnable implements Runnable {
++  
++          public void run() {
++  
++--- 1587,1593 ----
++          backgroundIt(new StatementExecRunnable(), "Executing SQL");
++      }
++  
++!     public class StatementExecRunnable implements Runnable {
++  
++          public void run() {
++  
++***************
++*** 1615,1621 ****
++      }
++      ;
++  
++!     private void executeSQL() {
++  
++          String[] g   = new String[1];
++          String   sql = null;
++--- 1615,1621 ----
++      }
++      ;
++  
++!     public void executeSQL() {
++  
++          String[] g   = new String[1];
++          String   sql = null;
++***************
++*** 1693,1699 ****
++       * results only if gridFormat is off (seems like it  does
++       * nothing otherwise, except for clearing help text and moving focus).
++       */
++!     private void updateResult() {
++  
++          if (gridFormat) {
++  
++--- 1693,1699 ----
++       * results only if gridFormat is off (seems like it  does
++       * nothing otherwise, except for clearing help text and moving focus).
++       */
++!     public void updateResult() {
++  
++          if (gridFormat) {
++  
++***************
++*** 1721,1727 ****
++       * VARCHARs, because this is the only class where there is any
++       * ambiguity about whether there is a null stored or not.
++       */
++!     private void formatResultSet(ResultSet r) {
++  
++          if (r == null) {
++              String[] g = new String[1];
++--- 1721,1727 ----
++       * VARCHARs, because this is the only class where there is any
++       * ambiguity about whether there is a null stored or not.
++       */
++!     public void formatResultSet(ResultSet r) {
++  
++          if (r == null) {
++              String[] g = new String[1];
++***************
++*** 1774,1780 ****
++          }
++      }
++  
++!     private void testPerformance() {
++  
++          String       all   = txtCommand.getText();
++          StringBuffer b     = new StringBuffer();
++--- 1774,1780 ----
++          }
++      }
++  
++!     public void testPerformance() {
++  
++          String       all   = txtCommand.getText();
++          StringBuffer b     = new StringBuffer();
++***************
++*** 1858,1864 ****
++       * Method declaration
++       *
++       */
++!     private void showResultInText() {
++  
++          Object[] col   = gResult.getHead();
++          int      width = col.length;
++--- 1858,1864 ----
++       * Method declaration
++       *
++       */
++!     public void showResultInText() {
++  
++          Object[] col   = gResult.getHead();
++          int      width = col.length;
++***************
++*** 1933,1939 ****
++          txtResult.setText(b.toString());
++      }
++  
++!     private void addToRecent(String s) {
++  
++          for (int i = 0; i < iMaxRecent; i++) {
++              if (s.equals(sRecent[i])) {
++--- 1933,1939 ----
++          txtResult.setText(b.toString());
++      }
++  
++!     public void addToRecent(String s) {
++  
++          for (int i = 0; i < iMaxRecent; i++) {
++              if (s.equals(sRecent[i])) {
++***************
++*** 1960,1966 ****
++          iRecent = (iRecent + 1) % iMaxRecent;
++      }
++  
++!     private void initGUI() {
++  
++          JPanel pCommand = new JPanel();
++  
++--- 1960,1966 ----
++          iRecent = (iRecent + 1) % iMaxRecent;
++      }
++  
++!     public void initGUI() {
++  
++          JPanel pCommand = new JPanel();
++  
++***************
++*** 2052,2058 ****
++  
++      /* Simple tree node factory method - set's parent and user object.
++       */
++!     private DefaultMutableTreeNode makeNode(Object userObject,
++              MutableTreeNode parent) {
++  
++          DefaultMutableTreeNode node = new DefaultMutableTreeNode(userObject);
++--- 2052,2058 ----
++  
++      /* Simple tree node factory method - set's parent and user object.
++       */
++!     public DefaultMutableTreeNode makeNode(Object userObject,
++              MutableTreeNode parent) {
++  
++          DefaultMutableTreeNode node = new DefaultMutableTreeNode(userObject);
++***************
++*** 2064,2077 ****
++          return node;
++      }
++  
++!     private static final String[] usertables       = {
++          "TABLE", "GLOBAL TEMPORARY", "VIEW", "SYSTEM TABLE"
++      };
++!     private static final String[] nonSystables     = {
++          "TABLE", "GLOBAL TEMPORARY", "VIEW"
++      };
++!     private static final HashSet  oracleSysUsers   = new HashSet();
++!     private static final String[] oracleSysSchemas = {
++          "SYS", "SYSTEM", "OUTLN", "DBSNMP", "OUTLN", "MDSYS", "ORDSYS",
++          "ORDPLUGINS", "CTXSYS", "DSSYS", "PERFSTAT", "WKPROXY", "WKSYS",
++          "WMSYS", "XDB", "ANONYMOUS", "ODM", "ODM_MTR", "OLAPSYS", "TRACESVR",
++--- 2064,2077 ----
++          return node;
++      }
++  
++!     public static final String[] usertables       = {
++          "TABLE", "GLOBAL TEMPORARY", "VIEW", "SYSTEM TABLE"
++      };
++!     public static final String[] nonSystables     = {
++          "TABLE", "GLOBAL TEMPORARY", "VIEW"
++      };
++!     public static final HashSet  oracleSysUsers   = new HashSet();
++!     public static final String[] oracleSysSchemas = {
++          "SYS", "SYSTEM", "OUTLN", "DBSNMP", "OUTLN", "MDSYS", "ORDSYS",
++          "ORDPLUGINS", "CTXSYS", "DSSYS", "PERFSTAT", "WKPROXY", "WKSYS",
++          "WMSYS", "XDB", "ANONYMOUS", "ODM", "ODM_MTR", "OLAPSYS", "TRACESVR",
++***************
++*** 2087,2093 ****
++      /**
++       * Schedules to run in a Gui-safe thread
++       */
++!     protected void refreshTree() {
++          backgroundIt(treeRefreshRunnable, "Refreshing object tree");
++      }
++  
++--- 2087,2093 ----
++      /**
++       * Schedules to run in a Gui-safe thread
++       */
++!     public void refreshTree() {
++          backgroundIt(treeRefreshRunnable, "Refreshing object tree");
++      }
++  
++***************
++*** 2096,2102 ****
++       *
++       * This method executes in current thread
++       */
++!     protected void directRefreshTree() {
++  
++          int[]                  rowCounts;
++          DefaultMutableTreeNode propertiesNode;
++--- 2096,2102 ----
++       *
++       * This method executes in current thread
++       */
++!     public void directRefreshTree() {
++  
++          int[]                  rowCounts;
++          DefaultMutableTreeNode propertiesNode;
++***************
++*** 2346,2352 ****
++      }
++  
++      // Added: (weconsultants@users) Needed to aggragate counts per table in jTree
++!     protected int[] getRowCounts(Vector inTable,
++                                   Vector inSchema) throws Exception {
++  
++          if (!displayRowCounts) {
++--- 2346,2352 ----
++      }
++  
++      // Added: (weconsultants@users) Needed to aggragate counts per table in jTree
++!     public int[] getRowCounts(Vector inTable,
++                                   Vector inSchema) throws Exception {
++  
++          if (!displayRowCounts) {
++***************
++*** 2390,2396 ****
++          return (counts);
++      }
++  
++!     protected JToolBar createToolBar() {
++  
++          // Build jtoolbar and jtoolbar Buttons
++          JToolBar jtoolbar = new JToolBar();
++--- 2390,2396 ----
++          return (counts);
++      }
++  
++!     public JToolBar createToolBar() {
++  
++          // Build jtoolbar and jtoolbar Buttons
++          JToolBar jtoolbar = new JToolBar();
++***************
++*** 2455,2461 ****
++          }
++      }
++  
++!     private void setLF(String newLAF) {
++  
++          if (currentLAF != null && currentLAF == newLAF) {    // No change
++              return;
++--- 2455,2461 ----
++          }
++      }
++  
++!     public void setLF(String newLAF) {
++  
++          if (currentLAF != null && currentLAF == newLAF) {    // No change
++              return;
++***************
++*** 2496,2502 ****
++          }
++      }
++  
++!     private void updateSchemaList() {
++  
++          ButtonGroup group  = new ButtonGroup();
++          ArrayList   list   = new ArrayList();
++--- 2496,2502 ----
++          }
++      }
++  
++!     public void updateSchemaList() {
++  
++          ButtonGroup group  = new ButtonGroup();
++          ArrayList   list   = new ArrayList();
++***************
++*** 2747,2752 ****
++          }
++      }
++  
++!     private static final String tString = Boolean.TRUE.toString();
++!     private static final String fString = Boolean.FALSE.toString();
++  }
++--- 2747,2752 ----
++          }
++      }
++  
++!     public static final String tString = Boolean.TRUE.toString();
++!     public static final String fString = Boolean.FALSE.toString();
++  }
++diff -crN hsqldb-old/src/org/hsqldb/util/FontDialogSwing.java hsqldb/src/org/hsqldb/util/FontDialogSwing.java
++*** hsqldb-old/src/org/hsqldb/util/FontDialogSwing.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/FontDialogSwing.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 56,84 ****
++  //        for JComboBox fontSizesComboBox and String fontSizes[];
++  public class FontDialogSwing extends JDialog {
++  
++!     private static boolean      isRunning   = false;
++!     private static final String BACKGROUND  = "Background";
++!     private static String       defaultFont = "Dialog";
++!     private static final String FOREGROUND  = "Foreground";
++!     private static JButton      bgColorButton;
++!     private static JCheckBox    ckbbold;
++!     private static JButton      closeButton;
++!     private static JButton      fgColorButton;
++!     private static JComboBox    fontsComboBox;
++  
++      //  weconsultants@users 20050215 - Added for Compatbilty fix for JDK 1.3
++!     private static JComboBox      fontSizesComboBox;
++!     private static final String[] fontSizes = {
++          "8", "9", "10", "11", "12", "13", "14", "16", "18", "24", "36"
++      };
++  
++      // weconsultants@users 20050215 - Commented out for Compatbilty fix for JDK 1.3
++!     //  private static JSpinner           spinnerFontSizes;
++!     //  private static SpinnerNumberModel spinnerModelSizes;
++!     private static DatabaseManagerSwing fOwner;
++!     private static JFrame frame =
++          new JFrame("DataBaseManagerSwing Font Selection Dialog");
++!     private static JCheckBox ckbitalic;
++  
++      /**
++       * Create and display FontDialogSwing Dialog.
++--- 56,84 ----
++  //        for JComboBox fontSizesComboBox and String fontSizes[];
++  public class FontDialogSwing extends JDialog {
++  
++!     public static boolean      isRunning   = false;
++!     public static final String BACKGROUND  = "Background";
++!     public static String       defaultFont = "Dialog";
++!     public static final String FOREGROUND  = "Foreground";
++!     public static JButton      bgColorButton;
++!     public static JCheckBox    ckbbold;
++!     public static JButton      closeButton;
++!     public static JButton      fgColorButton;
++!     public static JComboBox    fontsComboBox;
++  
++      //  weconsultants@users 20050215 - Added for Compatbilty fix for JDK 1.3
++!     public static JComboBox      fontSizesComboBox;
++!     public static final String[] fontSizes = {
++          "8", "9", "10", "11", "12", "13", "14", "16", "18", "24", "36"
++      };
++  
++      // weconsultants@users 20050215 - Commented out for Compatbilty fix for JDK 1.3
++!     //  public static JSpinner           spinnerFontSizes;
++!     //  public static SpinnerNumberModel spinnerModelSizes;
++!     public static DatabaseManagerSwing fOwner;
++!     public static JFrame frame =
++          new JFrame("DataBaseManagerSwing Font Selection Dialog");
++!     public static JCheckBox ckbitalic;
++  
++      /**
++       * Create and display FontDialogSwing Dialog.
++diff -crN hsqldb-old/src/org/hsqldb/util/Grid.java hsqldb/src/org/hsqldb/util/Grid.java
++*** hsqldb-old/src/org/hsqldb/util/Grid.java	2007-10-19 22:16:44.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/Grid.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 91,130 ****
++  class Grid extends Panel {
++  
++      // drawing
++!     private Dimension dMinimum;
++  
++  // boucherb@users changed access for databasemanager2
++!     protected Font fFont;
++  
++  // --------------------------------------------------
++!     private FontMetrics fMetrics;
++!     private Graphics    gImage;
++!     private Image       iImage;
++  
++      // height / width
++!     private int iWidth, iHeight;
++!     private int iRowHeight, iFirstRow;
++!     private int iGridWidth, iGridHeight;
++!     private int iX, iY;
++  
++      // data
++  // boucherb@users changed access for databasemanager2
++!     protected String[] sColHead = new String[0];
++!     protected Vector   vData    = new Vector();
++  
++  // --------------------------------------------------
++!     private int[] iColWidth;
++!     private int   iColCount;
++  
++  // boucherb@users changed access for databasemanager2
++!     protected int iRowCount;
++  
++  // --------------------------------------------------
++      // scrolling
++!     private Scrollbar sbHoriz, sbVert;
++!     private int       iSbWidth, iSbHeight;
++!     private boolean   bDrag;
++!     private int       iXDrag, iColDrag;
++  
++      /**
++       * Constructor declaration
++--- 91,130 ----
++  class Grid extends Panel {
++  
++      // drawing
++!     public Dimension dMinimum;
++  
++  // boucherb@users changed access for databasemanager2
++!     public Font fFont;
++  
++  // --------------------------------------------------
++!     public FontMetrics fMetrics;
++!     public Graphics    gImage;
++!     public Image       iImage;
++  
++      // height / width
++!     public int iWidth, iHeight;
++!     public int iRowHeight, iFirstRow;
++!     public int iGridWidth, iGridHeight;
++!     public int iX, iY;
++  
++      // data
++  // boucherb@users changed access for databasemanager2
++!     public String[] sColHead = new String[0];
++!     public Vector   vData    = new Vector();
++  
++  // --------------------------------------------------
++!     public int[] iColWidth;
++!     public int   iColCount;
++  
++  // boucherb@users changed access for databasemanager2
++!     public int iRowCount;
++  
++  // --------------------------------------------------
++      // scrolling
++!     public Scrollbar sbHoriz, sbVert;
++!     public int       iSbWidth, iSbHeight;
++!     public boolean   bDrag;
++!     public int       iXDrag, iColDrag;
++  
++      /**
++       * Constructor declaration
++***************
++*** 588,594 ****
++       *
++       * @param i
++       */
++!     private void calcAutoWidth(int i) {
++  
++          int w = 10;
++  
++--- 588,594 ----
++       *
++       * @param i
++       */
++!     public void calcAutoWidth(int i) {
++  
++          int w = 10;
++  
++***************
++*** 612,618 ****
++       *
++       * @return
++       */
++!     private String getDisplay(int x, int y) {
++          return (((String[]) (vData.elementAt(y)))[x]);
++      }
++  
++--- 612,618 ----
++       *
++       * @return
++       */
++!     public String getDisplay(int x, int y) {
++          return (((String[]) (vData.elementAt(y)))[x]);
++      }
++  
++***************
++*** 625,631 ****
++       *
++       * @return
++       */
++!     private String get(int x, int y) {
++          return (((String[]) (vData.elementAt(y)))[x]);
++      }
++  
++--- 625,631 ----
++       *
++       * @return
++       */
++!     public String get(int x, int y) {
++          return (((String[]) (vData.elementAt(y)))[x]);
++      }
++  
++***************
++*** 637,643 ****
++       *
++       * @return
++       */
++!     private static int getMaxHeight(FontMetrics f) {
++          return f.getHeight() + 4;
++      }
++  }
++--- 637,643 ----
++       *
++       * @return
++       */
++!     public static int getMaxHeight(FontMetrics f) {
++          return f.getHeight() + 4;
++      }
++  }
++diff -crN hsqldb-old/src/org/hsqldb/util/JDBCTypes.java hsqldb/src/org/hsqldb/util/JDBCTypes.java
++*** hsqldb-old/src/org/hsqldb/util/JDBCTypes.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/JDBCTypes.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 48,55 ****
++      public static final int BLOB        = 2004;
++      public static final int CLOB        = 2005;
++      public static final int REF         = 2006;
++!     private Hashtable       hStringJDBCtypes;
++!     private Hashtable       hIntJDBCtypes;
++  
++      JDBCTypes() {
++  
++--- 48,55 ----
++      public static final int BLOB        = 2004;
++      public static final int CLOB        = 2005;
++      public static final int REF         = 2006;
++!     public Hashtable       hStringJDBCtypes;
++!     public Hashtable       hIntJDBCtypes;
++  
++      JDBCTypes() {
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/MainInvoker.java hsqldb/src/org/hsqldb/util/MainInvoker.java
++*** hsqldb-old/src/org/hsqldb/util/MainInvoker.java	2007-06-21 10:49:20.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/MainInvoker.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 51,59 ****
++       * It may or may not make sense to make this into a class with real
++       * instances that can keep track of status of stuff invoked by it.
++       */
++!     private static String[] emptyStringArray = new String[0];
++  
++!     private static void syntaxFailure() {
++          System.err.println(SYNTAX_MSG);
++          System.exit(2);
++      }
++--- 51,59 ----
++       * It may or may not make sense to make this into a class with real
++       * instances that can keep track of status of stuff invoked by it.
++       */
++!     public static String[] emptyStringArray = new String[0];
++  
++!     public static void syntaxFailure() {
++          System.err.println(SYNTAX_MSG);
++          System.exit(2);
++      }
++***************
++*** 109,115 ****
++      }
++  
++      public static String LS = System.getProperty("line.separator");
++!     private static String SYNTAX_MSG =
++          "    java org.hsqldb.util.MainInvoker "
++          + "[package1.Class1 [arg1a arg1b...] \"\"]... \\\n"
++          + "    packageX.ClassX [argXa argXb...]\n" + "OR\n"
++--- 109,115 ----
++      }
++  
++      public static String LS = System.getProperty("line.separator");
++!     public static String SYNTAX_MSG =
++          "    java org.hsqldb.util.MainInvoker "
++          + "[package1.Class1 [arg1a arg1b...] \"\"]... \\\n"
++          + "    packageX.ClassX [argXa argXb...]\n" + "OR\n"
++diff -crN hsqldb-old/src/org/hsqldb/util/OracleTransferHelper.java hsqldb/src/org/hsqldb/util/OracleTransferHelper.java
++*** hsqldb-old/src/org/hsqldb/util/OracleTransferHelper.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/OracleTransferHelper.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 46,53 ****
++   */
++  class OracleTransferHelper extends TransferHelper {
++  
++!     private final int ORACLE = 0;
++!     private final int HSQLDB = 1;
++      String[][]        Funcs  = {
++          {
++              "now()", "\'now\'"
++--- 46,53 ----
++   */
++  class OracleTransferHelper extends TransferHelper {
++  
++!     public final int ORACLE = 0;
++!     public final int HSQLDB = 1;
++      String[][]        Funcs  = {
++          {
++              "now()", "\'now\'"
++diff -crN hsqldb-old/src/org/hsqldb/util/PostgresTransferHelper.java hsqldb/src/org/hsqldb/util/PostgresTransferHelper.java
++*** hsqldb-old/src/org/hsqldb/util/PostgresTransferHelper.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/PostgresTransferHelper.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 47,54 ****
++   */
++  class PostgresTransferHelper extends TransferHelper {
++  
++!     private final int PostgreSQL = 0;
++!     private final int HSQLDB     = 1;
++      String[][]        Funcs      = {
++          {
++              "now()", "\'now\'"
++--- 47,54 ----
++   */
++  class PostgresTransferHelper extends TransferHelper {
++  
++!     public final int PostgreSQL = 0;
++!     public final int HSQLDB     = 1;
++      String[][]        Funcs      = {
++          {
++              "now()", "\'now\'"
++diff -crN hsqldb-old/src/org/hsqldb/util/QueryTool.java hsqldb/src/org/hsqldb/util/QueryTool.java
++*** hsqldb-old/src/org/hsqldb/util/QueryTool.java	2006-07-27 22:04:30.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/QueryTool.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 419,425 ****
++      /**
++       * Adds a String to the Listbox of recent commands.
++       */
++!     private void setRecent(String s) {
++  
++          for (int i = 0; i < iMaxRecent; i++) {
++              if (s.equals(sRecent[i])) {
++--- 419,425 ----
++      /**
++       * Adds a String to the Listbox of recent commands.
++       */
++!     public void setRecent(String s) {
++  
++          for (int i = 0; i < iMaxRecent; i++) {
++              if (s.equals(sRecent[i])) {
++***************
++*** 449,455 ****
++      /**
++       * Create the graphical user interface. This is AWT code.
++       */
++!     private void initGUI() {
++  
++          // all panels
++          Panel pQuery       = new Panel();
++--- 449,455 ----
++      /**
++       * Create the graphical user interface. This is AWT code.
++       */
++!     public void initGUI() {
++  
++          // all panels
++          Panel pQuery       = new Panel();
++diff -crN hsqldb-old/src/org/hsqldb/util/RCData.java hsqldb/src/org/hsqldb/util/RCData.java
++*** hsqldb-old/src/org/hsqldb/util/RCData.java	2007-06-11 12:12:32.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/RCData.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 52,58 ****
++  public class RCData {
++  
++      public static final String DEFAULT_JDBC_DRIVER   = "org.hsqldb.jdbcDriver";
++!     private String             defaultJdbcDriverName = DEFAULT_JDBC_DRIVER;
++  
++      public void setDefaultJdbcDriver(String defaultJdbcDriverName) {
++          this.defaultJdbcDriverName = defaultJdbcDriverName;
++--- 52,58 ----
++  public class RCData {
++  
++      public static final String DEFAULT_JDBC_DRIVER   = "org.hsqldb.jdbcDriver";
++!     public String             defaultJdbcDriverName = DEFAULT_JDBC_DRIVER;
++  
++      public void setDefaultJdbcDriver(String defaultJdbcDriverName) {
++          this.defaultJdbcDriverName = defaultJdbcDriverName;
++diff -crN hsqldb-old/src/org/hsqldb/util/RefCapablePropertyResourceBundle.java hsqldb/src/org/hsqldb/util/RefCapablePropertyResourceBundle.java
++*** hsqldb-old/src/org/hsqldb/util/RefCapablePropertyResourceBundle.java	2007-10-19 22:16:44.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/RefCapablePropertyResourceBundle.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 154,169 ****
++   * @author  blaine.simpson@admc.com
++   */
++  public class RefCapablePropertyResourceBundle {
++!     private PropertyResourceBundle wrappedBundle;
++!     private String baseName;
++!     private String language, country, variant;
++!     static private Map allBundles = new HashMap();
++      public static String LS = System.getProperty("line.separator");
++!     private Pattern sysPropVarPattern = Pattern.compile(
++              "(?s)\\Q${\\E([^}]+?)(?:\\Q:+\\E([^}]+))?\\Q}");
++!     private Pattern posPattern = Pattern.compile(
++              "(?s)\\Q%{\\E(\\d)(?:\\Q:+\\E([^}]+))?\\Q}");
++!     private ClassLoader loader;  // Needed to load referenced files
++  
++      public static final int THROW_BEHAVIOR = 0;
++      public static final int EMPTYSTRING_BEHAVIOR = 1;
++--- 154,169 ----
++   * @author  blaine.simpson@admc.com
++   */
++  public class RefCapablePropertyResourceBundle {
++!     public PropertyResourceBundle wrappedBundle;
++!     public String baseName;
++!     public String language, country, variant;
++!     static public Map allBundles = new HashMap();
++      public static String LS = System.getProperty("line.separator");
++!     public Pattern sysPropVarPattern = Pattern.compile(
++              "(?s)\\Q${\\E([^}]+?)(?:\\Q:+\\E([^}]+))?\\Q}");
++!     public Pattern posPattern = Pattern.compile(
++              "(?s)\\Q%{\\E(\\d)(?:\\Q:+\\E([^}]+))?\\Q}");
++!     public ClassLoader loader;  // Needed to load referenced files
++  
++      public static final int THROW_BEHAVIOR = 0;
++      public static final int EMPTYSTRING_BEHAVIOR = 1;
++***************
++*** 173,179 ****
++          return wrappedBundle.getKeys();
++      }
++  
++!     private RefCapablePropertyResourceBundle(String baseName,
++              PropertyResourceBundle wrappedBundle, ClassLoader loader) {
++          this.baseName = baseName;
++          this.wrappedBundle = wrappedBundle;
++--- 173,179 ----
++          return wrappedBundle.getKeys();
++      }
++  
++!     public RefCapablePropertyResourceBundle(String baseName,
++              PropertyResourceBundle wrappedBundle, ClassLoader loader) {
++          this.baseName = baseName;
++          this.wrappedBundle = wrappedBundle;
++***************
++*** 349,355 ****
++       * Return a ref to a new or existing RefCapablePropertyResourceBundle,
++       * or throw a MissingResourceException.
++       */
++!     static private RefCapablePropertyResourceBundle getRef(String baseName,
++              ResourceBundle rb, ClassLoader loader) {
++          if (!(rb instanceof PropertyResourceBundle))
++              throw new MissingResourceException(
++--- 349,355 ----
++       * Return a ref to a new or existing RefCapablePropertyResourceBundle,
++       * or throw a MissingResourceException.
++       */
++!     static public RefCapablePropertyResourceBundle getRef(String baseName,
++              ResourceBundle rb, ClassLoader loader) {
++          if (!(rb instanceof PropertyResourceBundle))
++              throw new MissingResourceException(
++***************
++*** 368,374 ****
++      /**
++       * Recursive
++       */
++!     private InputStream getMostSpecificStream(
++              String key, String l, String c, String v) {
++          String filePath = baseName.replace('.', '/') + '/' + key
++                  + ((l == null) ? "" : ("_" + l))
++--- 368,374 ----
++      /**
++       * Recursive
++       */
++!     public InputStream getMostSpecificStream(
++              String key, String l, String c, String v) {
++          String filePath = baseName.replace('.', '/') + '/' + key
++                  + ((l == null) ? "" : ("_" + l))
++***************
++*** 385,391 ****
++              : is;
++      }
++  
++!     private String getStringFromFile(String key) {
++          byte[] ba = null;
++          int bytesread = 0;
++          int retval;
++--- 385,391 ----
++              : is;
++      }
++  
++!     public String getStringFromFile(String key) {
++          byte[] ba = null;
++          int bytesread = 0;
++          int retval;
++diff -crN hsqldb-old/src/org/hsqldb/util/ScriptTool.java hsqldb/src/org/hsqldb/util/ScriptTool.java
++*** hsqldb-old/src/org/hsqldb/util/ScriptTool.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ScriptTool.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 54,66 ****
++   */
++  public class ScriptTool {
++  
++!     private static Properties pProperties = new Properties();
++!     private Connection        cConn;
++!     private Statement         sStatement;
++!     private boolean           BATCH = true;
++!     private String            EKW   = new String("go");
++!     private boolean           EOF   = false;
++!     private int               ln    = 0;
++  
++      /**
++       * Main method
++--- 54,66 ----
++   */
++  public class ScriptTool {
++  
++!     public static Properties pProperties = new Properties();
++!     public Connection        cConn;
++!     public Statement         sStatement;
++!     public boolean           BATCH = true;
++!     public String            EKW   = new String("go");
++!     public boolean           EOF   = false;
++!     public int               ln    = 0;
++  
++      /**
++       * Main method
++***************
++*** 180,186 ****
++       * Translate ResultSet to String representation
++       * @param r
++       */
++!     private String toString(ResultSet r) {
++  
++          try {
++              if (r == null) {
++--- 180,186 ----
++       * Translate ResultSet to String representation
++       * @param r
++       */
++!     public String toString(ResultSet r) {
++  
++          try {
++              if (r == null) {
++***************
++*** 218,224 ****
++      /**
++       * Read file and convert it to string.
++       */
++!     private String fileToString(BufferedReader in) {
++  
++          if (EOF) {
++              return null;
++--- 218,224 ----
++      /**
++       * Read file and convert it to string.
++       */
++!     public String fileToString(BufferedReader in) {
++  
++          if (EOF) {
++              return null;
++***************
++*** 268,274 ****
++       *
++       * @param s
++       */
++!     private void trace(String s) {
++          System.out.println(s);
++      }
++  
++--- 268,274 ----
++       *
++       * @param s
++       */
++!     public void trace(String s) {
++          System.out.println(s);
++      }
++  
++***************
++*** 276,282 ****
++       * Method declaration
++       *
++       */
++!     private static void printHelp() {
++  
++          System.out.println(
++              "Usage: java ScriptTool [-options]\n"
++--- 276,282 ----
++       * Method declaration
++       *
++       */
++!     public static void printHelp() {
++  
++          System.out.println(
++              "Usage: java ScriptTool [-options]\n"
++diff -crN hsqldb-old/src/org/hsqldb/util/SqlFile.java hsqldb/src/org/hsqldb/util/SqlFile.java
++*** hsqldb-old/src/org/hsqldb/util/SqlFile.java	2007-10-11 11:32:18.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/SqlFile.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 118,175 ****
++   */
++  
++  public class SqlFile {
++!     private static final int DEFAULT_HISTORY_SIZE = 40;
++!     private File             file;
++!     private boolean          interactive;
++!     private String           primaryPrompt    = "sql> ";
++!     private String           rawPrompt      = null;
++!     private String           contPrompt       = "  +> ";
++!     private Connection       curConn          = null;
++!     private boolean          htmlMode         = false;
++!     private Map              userVars; // Always a non-null map set in cons.
++!     private List             history          = null;
++!     private int              rawMode          = RAW_FALSE;
++!     private String           nullRepToken     = null;
++!     private String           dsvTargetFile    = null;
++!     private String           dsvTargetTable   = null;
++!     private String           dsvConstCols     = null;
++!     private String           dsvRejectFile    = null;
++!     private String           dsvRejectReport  = null;
++      public static String     LS = System.getProperty("line.separator");
++!     private int              maxHistoryLength = 1;
++!     private SqltoolRB        rb               = null;
++!     private String           magicPrefix      = null;
++      // For append editing, this is automatically prefixed to what the
++      // user enters.
++  
++!     private static final int RAW_FALSE = 0; // Raw mode off
++!     private static final int RAW_EMPTY = 1; // Raw mode on, but no raw input yet
++!     private static final int RAW_DATA  = 2; // Raw mode on and we have input
++  
++      /**
++       * N.b. javax.util.regex Optional capture groups (...)? are completely
++       * unpredictable wrt whether you get a null capture group vs. no capture.
++       * Must always check count!
++       */
++!     private static Pattern   specialPattern =
++              Pattern.compile("\\s*\\\\(\\S+)(?:\\s+(.*\\S))?\\s*");
++!     private static Pattern   plPattern  =
++              Pattern.compile("\\s*\\*\\s*(.*\\S)?\\s*");
++!     private static Pattern   foreachPattern =
++              Pattern.compile("\\s*\\*\\s*foreach\\s+(\\S+)\\s*\\(([^)]*)\\)\\s*");
++!     private static Pattern   ifwhilePattern =
++              Pattern.compile("\\s*\\*\\s*\\S+\\s*\\(([^)]*)\\)\\s*");
++!     private static Pattern   varsetPattern =
++              Pattern.compile("\\s*\\*\\s*(\\S+)\\s*([=_~])\\s*(?:(.*\\S)\\s*)?");
++!     private static Pattern   substitutionPattern =
++              Pattern.compile("(\\S)(.+?)\\1(.*?)\\1(.+)?\\s*");
++              // Note that this pattern does not include the leading ":s".
++!     private static Pattern   slashHistoryPattern =
++              Pattern.compile("\\s*/([^/]+)/\\s*(\\S.*)?");
++!     private static Pattern   historyPattern =
++              Pattern.compile("\\s*(-?\\d+)?\\s*(\\S.*)?");
++              // Note that this pattern does not include the leading ":".
++!     private static Pattern wincmdPattern = null;
++  
++      static {
++          if (System.getProperty("os.name").startsWith("Windows")) {
++--- 118,175 ----
++   */
++  
++  public class SqlFile {
++!     public static final int DEFAULT_HISTORY_SIZE = 40;
++!     public File             file;
++!     public boolean          interactive;
++!     public String           primaryPrompt    = "sql> ";
++!     public String           rawPrompt      = null;
++!     public String           contPrompt       = "  +> ";
++!     public Connection       curConn          = null;
++!     public boolean          htmlMode         = false;
++!     public Map              userVars; // Always a non-null map set in cons.
++!     public List             history          = null;
++!     public int              rawMode          = RAW_FALSE;
++!     public String           nullRepToken     = null;
++!     public String           dsvTargetFile    = null;
++!     public String           dsvTargetTable   = null;
++!     public String           dsvConstCols     = null;
++!     public String           dsvRejectFile    = null;
++!     public String           dsvRejectReport  = null;
++      public static String     LS = System.getProperty("line.separator");
++!     public int              maxHistoryLength = 1;
++!     public SqltoolRB        rb               = null;
++!     public String           magicPrefix      = null;
++      // For append editing, this is automatically prefixed to what the
++      // user enters.
++  
++!     public static final int RAW_FALSE = 0; // Raw mode off
++!     public static final int RAW_EMPTY = 1; // Raw mode on, but no raw input yet
++!     public static final int RAW_DATA  = 2; // Raw mode on and we have input
++  
++      /**
++       * N.b. javax.util.regex Optional capture groups (...)? are completely
++       * unpredictable wrt whether you get a null capture group vs. no capture.
++       * Must always check count!
++       */
++!     public static Pattern   specialPattern =
++              Pattern.compile("\\s*\\\\(\\S+)(?:\\s+(.*\\S))?\\s*");
++!     public static Pattern   plPattern  =
++              Pattern.compile("\\s*\\*\\s*(.*\\S)?\\s*");
++!     public static Pattern   foreachPattern =
++              Pattern.compile("\\s*\\*\\s*foreach\\s+(\\S+)\\s*\\(([^)]*)\\)\\s*");
++!     public static Pattern   ifwhilePattern =
++              Pattern.compile("\\s*\\*\\s*\\S+\\s*\\(([^)]*)\\)\\s*");
++!     public static Pattern   varsetPattern =
++              Pattern.compile("\\s*\\*\\s*(\\S+)\\s*([=_~])\\s*(?:(.*\\S)\\s*)?");
++!     public static Pattern   substitutionPattern =
++              Pattern.compile("(\\S)(.+?)\\1(.*?)\\1(.+)?\\s*");
++              // Note that this pattern does not include the leading ":s".
++!     public static Pattern   slashHistoryPattern =
++              Pattern.compile("\\s*/([^/]+)/\\s*(\\S.*)?");
++!     public static Pattern   historyPattern =
++              Pattern.compile("\\s*(-?\\d+)?\\s*(\\S.*)?");
++              // Note that this pattern does not include the leading ":".
++!     public static Pattern wincmdPattern = null;
++  
++      static {
++          if (System.getProperty("os.name").startsWith("Windows")) {
++***************
++*** 190,196 ****
++       * is less reliable since there is no way to guarantee that the vars
++       * are not used without checking.
++       */
++!     private void updateUserSettings() {
++          dsvSkipPrefix = SqlFile.convertEscapes(
++                  (String) userVars.get("*DSV_SKIP_PREFIX"));
++          if (dsvSkipPrefix == null) {
++--- 190,196 ----
++       * is less reliable since there is no way to guarantee that the vars
++       * are not used without checking.
++       */
++!     public void updateUserSettings() {
++          dsvSkipPrefix = SqlFile.convertEscapes(
++                  (String) userVars.get("*DSV_SKIP_PREFIX"));
++          if (dsvSkipPrefix == null) {
++***************
++*** 244,252 ****
++       * Private class to "share" a variable among a family of SqlFile
++       * instances.
++       */
++!     private static class BooleanBucket {
++          BooleanBucket() {}
++!         private boolean bPriv = false;
++  
++          public void set(boolean bIn) {
++              bPriv = bIn;
++--- 244,252 ----
++       * Private class to "share" a variable among a family of SqlFile
++       * instances.
++       */
++!     public static class BooleanBucket {
++          BooleanBucket() {}
++!         public boolean bPriv = false;
++  
++          public void set(boolean bIn) {
++              bPriv = bIn;
++***************
++*** 262,284 ****
++      // be running DDL or a commit or rollback statement.  All we know is,
++      // they MAY run some DML that needs to be committed.
++  
++!     private static final String DIVIDER =
++          "-----------------------------------------------------------------"
++          + "-----------------------------------------------------------------";
++      // Needs to be at least as wide as the widest field or header displayed.
++!     private static final String SPACES =
++          "                                                                 "
++          + "                                                                 ";
++      // Needs to be at least as wide as the widest field or header displayed.
++!     private static String revnum = null;
++  
++      static {
++          revnum = "354";
++      }
++  
++!     private String DSV_OPTIONS_TEXT = null;
++!     private String D_OPTIONS_TEXT = null;
++!     private String RAW_LEADIN_MSG = null;
++  
++      /**
++       * Interpret lines of input file as SQL Statements, Comments,
++--- 262,284 ----
++      // be running DDL or a commit or rollback statement.  All we know is,
++      // they MAY run some DML that needs to be committed.
++  
++!     public static final String DIVIDER =
++          "-----------------------------------------------------------------"
++          + "-----------------------------------------------------------------";
++      // Needs to be at least as wide as the widest field or header displayed.
++!     public static final String SPACES =
++          "                                                                 "
++          + "                                                                 ";
++      // Needs to be at least as wide as the widest field or header displayed.
++!     public static String revnum = null;
++  
++      static {
++          revnum = "354";
++      }
++  
++!     public String DSV_OPTIONS_TEXT = null;
++!     public String D_OPTIONS_TEXT = null;
++!     public String RAW_LEADIN_MSG = null;
++  
++      /**
++       * Interpret lines of input file as SQL Statements, Comments,
++***************
++*** 374,396 ****
++  
++      // So we can tell how to handle quit and break commands.
++      public boolean      recursed     = false;
++!     private String      lastSqlStatement   = null;
++!     private int         curLinenum   = -1;
++!     private PrintStream psStd        = null;
++!     private PrintStream psErr        = null;
++!     private PrintWriter pwQuery      = null;
++!     private PrintWriter pwDsv        = null;
++      StringBuffer        immCmdSB     = new StringBuffer();
++!     private boolean             continueOnError = false;
++      /*
++       * This is reset upon each execute() invocation (to true if interactive,
++       * false otherwise).
++       */
++!     private static final String DEFAULT_CHARSET = null;
++      // Change to Charset.defaultCharset().name(); once we can use Java 1.5!
++!     private BufferedReader      br              = null;
++!     private String              charset         = null;
++!     private String              buffer          = null;
++  
++      /**
++       * Process all the commands in the file (or stdin) associated with
++--- 374,396 ----
++  
++      // So we can tell how to handle quit and break commands.
++      public boolean      recursed     = false;
++!     public String      lastSqlStatement   = null;
++!     public int         curLinenum   = -1;
++!     public PrintStream psStd        = null;
++!     public PrintStream psErr        = null;
++!     public PrintWriter pwQuery      = null;
++!     public PrintWriter pwDsv        = null;
++      StringBuffer        immCmdSB     = new StringBuffer();
++!     public boolean             continueOnError = false;
++      /*
++       * This is reset upon each execute() invocation (to true if interactive,
++       * false otherwise).
++       */
++!     public static final String DEFAULT_CHARSET = null;
++      // Change to Charset.defaultCharset().name(); once we can use Java 1.5!
++!     public BufferedReader      br              = null;
++!     public String              charset         = null;
++!     public String              buffer          = null;
++  
++      /**
++       * Process all the commands in the file (or stdin) associated with
++***************
++*** 792,798 ****
++       *                 a "copy" will be returned).
++       * @returns Null if inString contains no terminating semi-colon.
++       */
++!     private static String deTerminated(String inString) {
++          int index = inString.lastIndexOf(';');
++  
++          if (index < 0) {
++--- 792,798 ----
++       *                 a "copy" will be returned).
++       * @returns Null if inString contains no terminating semi-colon.
++       */
++!     public static String deTerminated(String inString) {
++          int index = inString.lastIndexOf(';');
++  
++          if (index < 0) {
++***************
++*** 813,819 ****
++       *
++       * Do not instantiate with null message.
++       */
++!     static private class BadSpecial extends AppendableException {
++          static final long serialVersionUID = 7162440064026570590L;
++  
++          BadSpecial(String s) {
++--- 813,819 ----
++       *
++       * Do not instantiate with null message.
++       */
++!     static public class BadSpecial extends AppendableException {
++          static final long serialVersionUID = 7162440064026570590L;
++  
++          BadSpecial(String s) {
++***************
++*** 837,843 ****
++       * Therefore, external users have no reason to specifically handle
++       * QuitNow.
++       */
++!     private class QuitNow extends SqlToolError {
++          static final long serialVersionUID = 1811094258670900488L;
++  
++          public QuitNow(String s) {
++--- 837,843 ----
++       * Therefore, external users have no reason to specifically handle
++       * QuitNow.
++       */
++!     public class QuitNow extends SqlToolError {
++          static final long serialVersionUID = 1811094258670900488L;
++  
++          public QuitNow(String s) {
++***************
++*** 856,862 ****
++       * Therefore, external users have no reason to specifically handle
++       * BreakException.
++       */
++!     private class BreakException extends SqlToolError {
++          static final long serialVersionUID = 351150072817675994L;
++  
++          public BreakException() {
++--- 856,862 ----
++       * Therefore, external users have no reason to specifically handle
++       * BreakException.
++       */
++!     public class BreakException extends SqlToolError {
++          static final long serialVersionUID = 351150072817675994L;
++  
++          public BreakException() {
++***************
++*** 875,881 ****
++       * Therefore, external users have no reason to specifically handle
++       * ContinueException.
++       */
++!     private class ContinueException extends SqlToolError {
++          static final long serialVersionUID = 5064604160827106014L;
++  
++          public ContinueException() {
++--- 875,881 ----
++       * Therefore, external users have no reason to specifically handle
++       * ContinueException.
++       */
++!     public class ContinueException extends SqlToolError {
++          static final long serialVersionUID = 5064604160827106014L;
++  
++          public ContinueException() {
++***************
++*** 890,896 ****
++      /**
++       * Utility nested Exception class for internal use only.
++       */
++!     private class BadSubst extends Exception {
++          static final long serialVersionUID = 7325933736897253269L;
++  
++          BadSubst(String s) {
++--- 890,896 ----
++      /**
++       * Utility nested Exception class for internal use only.
++       */
++!     public class BadSubst extends Exception {
++          static final long serialVersionUID = 7325933736897253269L;
++  
++          BadSubst(String s) {
++***************
++*** 901,907 ****
++      /**
++       * Utility nested Exception class for internal use only.
++       */
++!     private class RowError extends AppendableException {
++          static final long serialVersionUID = 754346434606022750L;
++  
++          RowError(String s) {
++--- 901,907 ----
++      /**
++       * Utility nested Exception class for internal use only.
++       */
++!     public class RowError extends AppendableException {
++          static final long serialVersionUID = 754346434606022750L;
++  
++          RowError(String s) {
++***************
++*** 949,955 ****
++       * @throws BadSpecial    special-command-specific errors.
++       * @throws SqlToolError  all other errors.
++       */
++!     private void processBuffHist(String inString)
++      throws BadSpecial, SQLException, SqlToolError {
++          if (inString.length() < 1) {
++              throw new BadSpecial(rb.getString(SqltoolRB.BUFHIST_UNSPECIFIED));
++--- 949,955 ----
++       * @throws BadSpecial    special-command-specific errors.
++       * @throws SqlToolError  all other errors.
++       */
++!     public void processBuffHist(String inString)
++      throws BadSpecial, SQLException, SqlToolError {
++          if (inString.length() < 1) {
++              throw new BadSpecial(rb.getString(SqltoolRB.BUFHIST_UNSPECIFIED));
++***************
++*** 1184,1207 ****
++                  Character.toString(commandChar)));
++      }
++  
++!     private boolean doPrepare   = false;
++!     private String  prepareVar  = null;
++!     private String  dsvColDelim = null;
++!     private String  dsvSkipPrefix = null;
++!     private String  dsvRowDelim = null;
++!     private String  dsvSkipCols = null;
++!     private String  DSV_X_SYNTAX_MSG = null;
++!     private String  DSV_M_SYNTAX_MSG = null;
++!     private String  nobufferYetString = null;
++  
++!     private void enforce1charSpecial(String token, char command)
++              throws BadSpecial {
++          if (token.length() != 1) {
++              throw new BadSpecial(rb.getString(SqltoolRB.SPECIAL_EXTRACHARS,
++                       Character.toString(command), token.substring(1)));
++          }
++      }
++!     private void enforce1charBH(String token, char command)
++              throws BadSpecial {
++          if (token != null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.BUFFER_EXTRACHARS,
++--- 1184,1207 ----
++                  Character.toString(commandChar)));
++      }
++  
++!     public boolean doPrepare   = false;
++!     public String  prepareVar  = null;
++!     public String  dsvColDelim = null;
++!     public String  dsvSkipPrefix = null;
++!     public String  dsvRowDelim = null;
++!     public String  dsvSkipCols = null;
++!     public String  DSV_X_SYNTAX_MSG = null;
++!     public String  DSV_M_SYNTAX_MSG = null;
++!     public String  nobufferYetString = null;
++  
++!     public void enforce1charSpecial(String token, char command)
++              throws BadSpecial {
++          if (token.length() != 1) {
++              throw new BadSpecial(rb.getString(SqltoolRB.SPECIAL_EXTRACHARS,
++                       Character.toString(command), token.substring(1)));
++          }
++      }
++!     public void enforce1charBH(String token, char command)
++              throws BadSpecial {
++          if (token != null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.BUFFER_EXTRACHARS,
++***************
++*** 1219,1225 ****
++       * @throws SqlToolError all other errors, plus QuitNow,
++       *                      BreakException, ContinueException.
++       */
++!     private void processSpecial(String inString)
++      throws BadSpecial, QuitNow, SQLException, SqlToolError {
++          if (inString.equals("\\")) {
++              throw new BadSpecial(rb.getString(SqltoolRB.SPECIAL_UNSPECIFIED));
++--- 1219,1225 ----
++       * @throws SqlToolError all other errors, plus QuitNow,
++       *                      BreakException, ContinueException.
++       */
++!     public void processSpecial(String inString)
++      throws BadSpecial, QuitNow, SQLException, SqlToolError {
++          if (inString.equals("\\")) {
++              throw new BadSpecial(rb.getString(SqltoolRB.SPECIAL_UNSPECIFIED));
++***************
++*** 1661,1667 ****
++                  Character.toString(arg1.charAt(0))));
++      }
++  
++!     private static final char[] nonVarChars = {
++          ' ', '\t', '=', '}', '\n', '\r'
++      };
++  
++--- 1661,1667 ----
++                  Character.toString(arg1.charAt(0))));
++      }
++  
++!     public static final char[] nonVarChars = {
++          ' ', '\t', '=', '}', '\n', '\r'
++      };
++  
++***************
++*** 1693,1699 ****
++       *
++       * @throws SqlToolError
++       */
++!     private String dereference(String inString,
++                                 boolean permitAlias) throws SqlToolError {
++          /* TODO:  Rewrite using java.util.regex. */
++          String       varName, varValue;
++--- 1693,1699 ----
++       *
++       * @throws SqlToolError
++       */
++!     public String dereference(String inString,
++                                 boolean permitAlias) throws SqlToolError {
++          /* TODO:  Rewrite using java.util.regex. */
++          String       varName, varValue;
++***************
++*** 1819,1827 ****
++      public boolean plMode = false;
++  
++      //  PL variable name currently awaiting query output.
++!     private String  fetchingVar = null;
++!     private boolean silentFetch = false;
++!     private boolean fetchBinary = false;
++  
++      /**
++       * Process a Process Language Command.
++--- 1819,1827 ----
++      public boolean plMode = false;
++  
++      //  PL variable name currently awaiting query output.
++!     public String  fetchingVar = null;
++!     public boolean silentFetch = false;
++!     public boolean fetchBinary = false;
++  
++      /**
++       * Process a Process Language Command.
++***************
++*** 1832,1838 ****
++       * @throws SqlToolError all other errors, plus BreakException and
++       *                      ContinueException.
++       */
++!     private void processPL(String inString) throws BadSpecial, SqlToolError {
++          Matcher m = plPattern.matcher(dereference(inString, false));
++          if (!m.matches()) {
++              throw new BadSpecial(rb.getString(SqltoolRB.PL_MALFORMAT));
++--- 1832,1838 ----
++       * @throws SqlToolError all other errors, plus BreakException and
++       *                      ContinueException.
++       */
++!     public void processPL(String inString) throws BadSpecial, SqlToolError {
++          Matcher m = plPattern.matcher(dereference(inString, false));
++          if (!m.matches()) {
++              throw new BadSpecial(rb.getString(SqltoolRB.PL_MALFORMAT));
++***************
++*** 2230,2236 ****
++       * @throws IOException
++       * @throws SqlToolError
++       */
++!     private File plBlockFile(String seeking) throws IOException, SqlToolError {
++          String          s;
++  
++          // Have already read the if/while/foreach statement, so we are already
++--- 2230,2236 ----
++       * @throws IOException
++       * @throws SqlToolError
++       */
++!     public File plBlockFile(String seeking) throws IOException, SqlToolError {
++          String          s;
++  
++          // Have already read the if/while/foreach statement, so we are already
++***************
++*** 2320,2335 ****
++       * Wrapper methods so don't need to call x(..., false) in most cases.
++       */
++      /* Unused.  Enable when/if need.
++!     private void stdprintln() {
++          stdprintln(false);
++      }
++      */
++  
++!     private void stdprint(String s) {
++          stdprint(s, false);
++      }
++  
++!     private void stdprintln(String s) {
++          stdprintln(s, false);
++      }
++  
++--- 2320,2335 ----
++       * Wrapper methods so don't need to call x(..., false) in most cases.
++       */
++      /* Unused.  Enable when/if need.
++!     public void stdprintln() {
++          stdprintln(false);
++      }
++      */
++  
++!     public void stdprint(String s) {
++          stdprint(s, false);
++      }
++  
++!     public void stdprintln(String s) {
++          stdprintln(s, false);
++      }
++  
++***************
++*** 2338,2344 ****
++       *
++       * Conditionally HTML-ifies output.
++       */
++!     private void stdprintln(boolean queryOutput) {
++          if (htmlMode) {
++              psStd.println("<BR>");
++          } else {
++--- 2338,2344 ----
++       *
++       * Conditionally HTML-ifies output.
++       */
++!     public void stdprintln(boolean queryOutput) {
++          if (htmlMode) {
++              psStd.println("<BR>");
++          } else {
++***************
++*** 2361,2367 ****
++       *
++       * Conditionally HTML-ifies error output.
++       */
++!     private void errprint(String s) {
++          psErr.print(htmlMode
++                      ? ("<DIV style='color:white; background: red; "
++                         + "font-weight: bold'>" + s + "</DIV>")
++--- 2361,2367 ----
++       *
++       * Conditionally HTML-ifies error output.
++       */
++!     public void errprint(String s) {
++          psErr.print(htmlMode
++                      ? ("<DIV style='color:white; background: red; "
++                         + "font-weight: bold'>" + s + "</DIV>")
++***************
++*** 2373,2379 ****
++       *
++       * Conditionally HTML-ifies error output.
++       */
++!     private void errprintln(String s) {
++          psErr.println(htmlMode
++                        ? ("<DIV style='color:white; background: red; "
++                           + "font-weight: bold'>" + s + "</DIV>")
++--- 2373,2379 ----
++       *
++       * Conditionally HTML-ifies error output.
++       */
++!     public void errprintln(String s) {
++          psErr.println(htmlMode
++                        ? ("<DIV style='color:white; background: red; "
++                           + "font-weight: bold'>" + s + "</DIV>")
++***************
++*** 2385,2391 ****
++       *
++       * Conditionally HTML-ifies output.
++       */
++!     private void stdprint(String s, boolean queryOutput) {
++          psStd.print(htmlMode ? ("<P>" + s + "</P>")
++                               : s);
++  
++--- 2385,2391 ----
++       *
++       * Conditionally HTML-ifies output.
++       */
++!     public void stdprint(String s, boolean queryOutput) {
++          psStd.print(htmlMode ? ("<P>" + s + "</P>")
++                               : s);
++  
++***************
++*** 2401,2407 ****
++       *
++       * Conditionally HTML-ifies output.
++       */
++!     private void stdprintln(String s, boolean queryOutput) {
++          psStd.println(htmlMode ? ("<P>" + s + "</P>")
++                                 : s);
++  
++--- 2401,2407 ----
++       *
++       * Conditionally HTML-ifies output.
++       */
++!     public void stdprintln(String s, boolean queryOutput) {
++          psStd.println(htmlMode ? ("<P>" + s + "</P>")
++                                 : s);
++  
++***************
++*** 2415,2437 ****
++      // Just because users may be used to seeing "[null]" in normal
++      // SqlFile output, we use the same default value for null in DSV
++      // files, but this DSV null representation can be changed to anything.
++!     private static final String DEFAULT_NULL_REP = "[null]";
++!     private static final String DEFAULT_ROW_DELIM = LS;
++!     private static final String DEFAULT_COL_DELIM = "|";
++!     private static final String DEFAULT_SKIP_PREFIX = "#";
++!     private static final int    DEFAULT_ELEMENT   = 0,
++                                  HSQLDB_ELEMENT    = 1,
++                                  ORACLE_ELEMENT    = 2
++      ;
++  
++      // These do not specify order listed, just inclusion.
++!     private static final int[] listMDSchemaCols = { 1 };
++!     private static final int[] listMDIndexCols  = {
++          2, 6, 3, 9, 4, 10, 11
++      };
++  
++      /** Column numbering starting at 1. */
++!     private static final int[][] listMDTableCols = {
++          {
++              2, 3
++          },    // Default
++--- 2415,2437 ----
++      // Just because users may be used to seeing "[null]" in normal
++      // SqlFile output, we use the same default value for null in DSV
++      // files, but this DSV null representation can be changed to anything.
++!     public static final String DEFAULT_NULL_REP = "[null]";
++!     public static final String DEFAULT_ROW_DELIM = LS;
++!     public static final String DEFAULT_COL_DELIM = "|";
++!     public static final String DEFAULT_SKIP_PREFIX = "#";
++!     public static final int    DEFAULT_ELEMENT   = 0,
++                                  HSQLDB_ELEMENT    = 1,
++                                  ORACLE_ELEMENT    = 2
++      ;
++  
++      // These do not specify order listed, just inclusion.
++!     public static final int[] listMDSchemaCols = { 1 };
++!     public static final int[] listMDIndexCols  = {
++          2, 6, 3, 9, 4, 10, 11
++      };
++  
++      /** Column numbering starting at 1. */
++!     public static final int[][] listMDTableCols = {
++          {
++              2, 3
++          },    // Default
++***************
++*** 2464,2470 ****
++       * SCOTT, ADAMS, JONES, CLARK, BLAKE, OE, PM, SH, QS, QS_*, these
++       * contain sample data and the schemas can safely be removed.
++       */
++!     private static final String[] oracleSysSchemas = {
++          "SYS", "SYSTEM", "OUTLN", "DBSNMP", "OUTLN", "MDSYS", "ORDSYS",
++          "ORDPLUGINS", "CTXSYS", "DSSYS", "PERFSTAT", "WKPROXY", "WKSYS",
++          "WMSYS", "XDB", "ANONYMOUS", "ODM", "ODM_MTR", "OLAPSYS", "TRACESVR",
++--- 2464,2470 ----
++       * SCOTT, ADAMS, JONES, CLARK, BLAKE, OE, PM, SH, QS, QS_*, these
++       * contain sample data and the schemas can safely be removed.
++       */
++!     public static final String[] oracleSysSchemas = {
++          "SYS", "SYSTEM", "OUTLN", "DBSNMP", "OUTLN", "MDSYS", "ORDSYS",
++          "ORDPLUGINS", "CTXSYS", "DSSYS", "PERFSTAT", "WKPROXY", "WKSYS",
++          "WMSYS", "XDB", "ANONYMOUS", "ODM", "ODM_MTR", "OLAPSYS", "TRACESVR",
++***************
++*** 2482,2488 ****
++       *                    SQLException in some cases).
++       * @throws SqlToolError passed through from other methods in this class.
++       */
++!     private void listTables(char c, String inFilter) throws BadSpecial,
++              SqlToolError {
++          String   schema  = null;
++          int[]    listSet = null;
++--- 2482,2488 ----
++       *                    SQLException in some cases).
++       * @throws SqlToolError passed through from other methods in this class.
++       */
++!     public void listTables(char c, String inFilter) throws BadSpecial,
++              SqlToolError {
++          String   schema  = null;
++          int[]    listSet = null;
++***************
++*** 2799,2805 ****
++          }
++      }
++  
++!     private boolean excludeSysSchemas = false;
++  
++      /**
++       * Process the contents of Edit Buffer as an SQL Statement
++--- 2799,2805 ----
++          }
++      }
++  
++!     public boolean excludeSysSchemas = false;
++  
++      /**
++       * Process the contents of Edit Buffer as an SQL Statement
++***************
++*** 2807,2813 ****
++       * @throws SQLException thrown by JDBC driver.
++       * @throws SqlToolError all other errors.
++       */
++!     private void processSQL() throws SQLException, SqlToolError {
++          // Really don't know whether to take the network latency hit here
++          // in order to check autoCommit in order to set
++          // possiblyUncommitteds more accurately.
++--- 2807,2813 ----
++       * @throws SQLException thrown by JDBC driver.
++       * @throws SqlToolError all other errors.
++       */
++!     public void processSQL() throws SQLException, SqlToolError {
++          // Really don't know whether to take the network latency hit here
++          // in order to check autoCommit in order to set
++          // possiblyUncommitteds more accurately.
++***************
++*** 2895,2901 ****
++       * @throws SQLException thrown by JDBC driver.
++       * @throws SqlToolError all other errors.
++       */
++!     private void displayResultSet(Statement statement, ResultSet r,
++                                    int[] incCols,
++                                    String filter) throws SQLException,
++                                    SqlToolError {
++--- 2895,2901 ----
++       * @throws SQLException thrown by JDBC driver.
++       * @throws SqlToolError all other errors.
++       */
++!     public void displayResultSet(Statement statement, ResultSet r,
++                                    int[] incCols,
++                                    String filter) throws SQLException,
++                                    SqlToolError {
++***************
++*** 3301,3312 ****
++          }
++      }
++  
++!     private static final int    COL_HEAD = 0,
++                                  COL_ODD  = 1,
++                                  COL_EVEN = 2
++      ;
++!     private static final String PRE_TR   = spaces(4);
++!     private static final String PRE_TD   = spaces(8);
++  
++      /**
++       * Print a properly formatted HTML &lt;TR&gt; command for the given
++--- 3301,3312 ----
++          }
++      }
++  
++!     public static final int    COL_HEAD = 0,
++                                  COL_ODD  = 1,
++                                  COL_EVEN = 2
++      ;
++!     public static final String PRE_TR   = spaces(4);
++!     public static final String PRE_TD   = spaces(8);
++  
++      /**
++       * Print a properly formatted HTML &lt;TR&gt; command for the given
++***************
++*** 3314,3320 ****
++       *
++       * @param colType Column type:  COL_HEAD, COL_ODD or COL_EVEN.
++       */
++!     private static String htmlRow(int colType) {
++          switch (colType) {
++              case COL_HEAD :
++                  return PRE_TR + "<TR style='font-weight: bold;'>";
++--- 3314,3320 ----
++       *
++       * @param colType Column type:  COL_HEAD, COL_ODD or COL_EVEN.
++       */
++!     public static String htmlRow(int colType) {
++          switch (colType) {
++              case COL_HEAD :
++                  return PRE_TR + "<TR style='font-weight: bold;'>";
++***************
++*** 3338,3344 ****
++       *
++       * @param len Length of output String.
++       */
++!     private static String divider(int len) {
++          return (len > DIVIDER.length()) ? DIVIDER
++                                          : DIVIDER.substring(0, len);
++      }
++--- 3338,3344 ----
++       *
++       * @param len Length of output String.
++       */
++!     public static String divider(int len) {
++          return (len > DIVIDER.length()) ? DIVIDER
++                                          : DIVIDER.substring(0, len);
++      }
++***************
++*** 3348,3354 ****
++       *
++       * @param len Length of output String.
++       */
++!     private static String spaces(int len) {
++          return (len > SPACES.length()) ? SPACES
++                                         : SPACES.substring(0, len);
++      }
++--- 3348,3354 ----
++       *
++       * @param len Length of output String.
++       */
++!     public static String spaces(int len) {
++          return (len > SPACES.length()) ? SPACES
++                                         : SPACES.substring(0, len);
++      }
++***************
++*** 3361,3367 ****
++       * @param fulllen  Output String length.
++       * @param rightJustify  True to right justify, false to left justify.
++       */
++!     private static String pad(String inString, int fulllen,
++                                boolean rightJustify, boolean doPad) {
++          if (!doPad) {
++              return inString;
++--- 3361,3367 ----
++       * @param fulllen  Output String length.
++       * @param rightJustify  True to right justify, false to left justify.
++       */
++!     public static String pad(String inString, int fulllen,
++                                boolean rightJustify, boolean doPad) {
++          if (!doPad) {
++              return inString;
++***************
++*** 3383,3389 ****
++      /**
++       * Display command history.
++       */
++!     private void showHistory() throws BadSpecial {
++          if (history == null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.HISTORY_UNAVAILABLE));
++          }
++--- 3383,3389 ----
++      /**
++       * Display command history.
++       */
++!     public void showHistory() throws BadSpecial {
++          if (history == null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.HISTORY_UNAVAILABLE));
++          }
++***************
++*** 3406,3412 ****
++      /**
++       * Return a Command from command history.
++       */
++!     private String commandFromHistory(int inIndex) throws BadSpecial {
++          int index = inIndex;  // Just to quiet compiler warnings.
++  
++          if (history == null) {
++--- 3406,3412 ----
++      /**
++       * Return a Command from command history.
++       */
++!     public String commandFromHistory(int inIndex) throws BadSpecial {
++          int index = inIndex;  // Just to quiet compiler warnings.
++  
++          if (history == null) {
++***************
++*** 3442,3448 ****
++       *
++       * @returns Absolute command number, if any match.
++       */
++!     private Integer historySearch(String findRegex) throws BadSpecial {
++          if (history == null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.HISTORY_UNAVAILABLE));
++          }
++--- 3442,3448 ----
++       *
++       * @returns Absolute command number, if any match.
++       */
++!     public Integer historySearch(String findRegex) throws BadSpecial {
++          if (history == null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.HISTORY_UNAVAILABLE));
++          }
++***************
++*** 3455,3461 ****
++          return null;
++      }
++  
++!     private void setBuf(String newContent) {
++          buffer = new String(newContent);
++          // System.err.println("Buffer is now (" + buffer + ')');
++      }
++--- 3455,3461 ----
++          return null;
++      }
++  
++!     public void setBuf(String newContent) {
++          buffer = new String(newContent);
++          // System.err.println("Buffer is now (" + buffer + ')');
++      }
++***************
++*** 3465,3471 ****
++      /**
++       * Add a command onto the history list.
++       */
++!     private void historize() {
++          if (history == null || buffer == null) {
++              return;
++          }
++--- 3465,3471 ----
++      /**
++       * Add a command onto the history list.
++       */
++!     public void historize() {
++          if (history == null || buffer == null) {
++              return;
++          }
++***************
++*** 3488,3494 ****
++       * @param tableName  Table that will be described.
++       * @param filter  Substring to filter by
++       */
++!     private void describe(String tableName,
++                            String inFilter) throws SQLException {
++          /*
++           * Doing case-sensitive filters now, for greater portability.
++--- 3488,3494 ----
++       * @param tableName  Table that will be described.
++       * @param filter  Substring to filter by
++       */
++!     public void describe(String tableName,
++                            String inFilter) throws SQLException {
++          /*
++           * Doing case-sensitive filters now, for greater portability.
++***************
++*** 3617,3623 ****
++          }
++      }
++  
++!     private boolean eval(String[] inTokens) throws BadSpecial {
++          /* TODO:  Rewrite using java.util.regex.  */
++          // dereference *VARNAME variables.
++          // N.b. we work with a "copy" of the tokens.
++--- 3617,3623 ----
++          }
++      }
++  
++!     public boolean eval(String[] inTokens) throws BadSpecial {
++          /* TODO:  Rewrite using java.util.regex.  */
++          // dereference *VARNAME variables.
++          // N.b. we work with a "copy" of the tokens.
++***************
++*** 3669,3675 ****
++          throw new BadSpecial(rb.getString(SqltoolRB.LOGICAL_UNRECOGNIZED));
++      }
++  
++!     private void closeQueryOutputStream() {
++          if (pwQuery == null) {
++              return;
++          }
++--- 3669,3675 ----
++          throw new BadSpecial(rb.getString(SqltoolRB.LOGICAL_UNRECOGNIZED));
++      }
++  
++!     public void closeQueryOutputStream() {
++          if (pwQuery == null) {
++              return;
++          }
++***************
++*** 3688,3694 ****
++       * Print to psStd and possibly pwQuery iff current HTML mode matches
++       * supplied printHtml.
++       */
++!     private void condlPrintln(String s, boolean printHtml) {
++          if ((printHtml &&!htmlMode) || (htmlMode &&!printHtml)) {
++              return;
++          }
++--- 3688,3694 ----
++       * Print to psStd and possibly pwQuery iff current HTML mode matches
++       * supplied printHtml.
++       */
++!     public void condlPrintln(String s, boolean printHtml) {
++          if ((printHtml &&!htmlMode) || (htmlMode &&!printHtml)) {
++              return;
++          }
++***************
++*** 3705,3711 ****
++       * Print to psStd and possibly pwQuery iff current HTML mode matches
++       * supplied printHtml.
++       */
++!     private void condlPrint(String s, boolean printHtml) {
++          if ((printHtml &&!htmlMode) || (htmlMode &&!printHtml)) {
++              return;
++          }
++--- 3705,3711 ----
++       * Print to psStd and possibly pwQuery iff current HTML mode matches
++       * supplied printHtml.
++       */
++!     public void condlPrint(String s, boolean printHtml) {
++          if ((printHtml &&!htmlMode) || (htmlMode &&!printHtml)) {
++              return;
++          }
++***************
++*** 3718,3724 ****
++          }
++      }
++  
++!     private String formatNicely(Map map, boolean withValues) {
++          String       key;
++          StringBuffer sb = new StringBuffer();
++          Iterator     it = (new TreeMap(map)).keySet().iterator();
++--- 3718,3724 ----
++          }
++      }
++  
++!     public String formatNicely(Map map, boolean withValues) {
++          String       key;
++          StringBuffer sb = new StringBuffer();
++          Iterator     it = (new TreeMap(map)).keySet().iterator();
++***************
++*** 3747,3753 ****
++       *
++       * dumpFile must not be null.
++       */
++!     private void dump(String varName,
++                        File dumpFile) throws IOException, BadSpecial {
++          String val = (String) userVars.get(varName);
++  
++--- 3747,3753 ----
++       *
++       * dumpFile must not be null.
++       */
++!     public void dump(String varName,
++                        File dumpFile) throws IOException, BadSpecial {
++          String val = (String) userVars.get(varName);
++  
++***************
++*** 3792,3798 ****
++       *
++       * dumpFile must not be null.
++       */
++!     private void dump(File dumpFile) throws IOException, BadSpecial {
++          if (binBuffer == null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.BINBUFFER_EMPTY));
++          }
++--- 3792,3798 ----
++       *
++       * dumpFile must not be null.
++       */
++!     public void dump(File dumpFile) throws IOException, BadSpecial {
++          if (binBuffer == null) {
++              throw new BadSpecial(rb.getString(SqltoolRB.BINBUFFER_EMPTY));
++          }
++***************
++*** 3856,3862 ****
++      /**
++       * Ascii file load.
++       */
++!     private void load(String varName, File asciiFile, String cs)
++              throws IOException {
++          String string = streamToString(new FileInputStream(asciiFile), cs);
++          userVars.put(varName, string);
++--- 3856,3862 ----
++      /**
++       * Ascii file load.
++       */
++!     public void load(String varName, File asciiFile, String cs)
++              throws IOException {
++          String string = streamToString(new FileInputStream(asciiFile), cs);
++          userVars.put(varName, string);
++***************
++*** 3936,3943 ****
++      }
++  
++      // won't compile with JDK 1.3 without these
++!     private static final int JDBC3_BOOLEAN  = 16;
++!     private static final int JDBC3_DATALINK = 70;
++  
++      public static String sqlTypeToString(int i) {
++          switch (i) {
++--- 3936,3943 ----
++      }
++  
++      // won't compile with JDK 1.3 without these
++!     public static final int JDBC3_BOOLEAN  = 16;
++!     public static final int JDBC3_DATALINK = 70;
++  
++      public static String sqlTypeToString(int i) {
++          switch (i) {
++***************
++*** 4102,4108 ****
++      /**
++       * @param string  Non-null String to modify.
++       */
++!     private static String convertNumericEscapes(String string) {
++          String workString = string;
++          int i = 0;
++  
++--- 4102,4108 ----
++      /**
++       * @param string  Non-null String to modify.
++       */
++!     public static String convertNumericEscapes(String string) {
++          String workString = string;
++          int i = 0;
++  
++***************
++*** 4126,4132 ****
++      /**
++       * @offset  Position of the leading \.
++       */
++!     private static String convertNumericEscape(String string, int offset) {
++          int post = -1;
++          int firstDigit = -1;
++          int radix = -1;
++--- 4126,4132 ----
++      /**
++       * @offset  Position of the leading \.
++       */
++!     public static String convertNumericEscape(String string, int offset) {
++          int post = -1;
++          int firstDigit = -1;
++          int radix = -1;
++***************
++*** 4150,4156 ****
++      /**
++       * @param string  Non-null String to modify.
++       */
++!     private static String convertEscapes(String string, String from, String to) {
++          String workString = string;
++          int i = 0;
++          int fromLen = from.length();
++--- 4150,4156 ----
++      /**
++       * @param string  Non-null String to modify.
++       */
++!     public static String convertEscapes(String string, String from, String to) {
++          String workString = string;
++          int i = 0;
++          int fromLen = from.length();
++***************
++*** 4789,4795 ****
++       * Does a poor-man's parse of a MSDOS command line and parses it
++       * into a WIndows cmd.exe invocation to approximate.
++       */
++!     static private String[] genWinArgs(String monolithic) {
++          List list = new ArrayList();
++          list.add("cmd.exe");
++          list.add("/y");
++--- 4789,4795 ----
++       * Does a poor-man's parse of a MSDOS command line and parses it
++       * into a WIndows cmd.exe invocation to approximate.
++       */
++!     static public String[] genWinArgs(String monolithic) {
++          List list = new ArrayList();
++          list.add("cmd.exe");
++          list.add("/y");
++***************
++*** 4811,4817 ****
++          return (String[]) list.toArray(new String[] {});
++      }
++  
++!     private void genRejectReportRecord(PrintWriter pw, int rCount,
++              int lCount, String field, String eMsg, Throwable cause) {
++          pw.println(rb.getString(SqltoolRB.REJECTREPORT_ROW,
++                  new String[] {
++--- 4811,4817 ----
++          return (String[]) list.toArray(new String[] {});
++      }
++  
++!     public void genRejectReportRecord(PrintWriter pw, int rCount,
++              int lCount, String field, String eMsg, Throwable cause) {
++          pw.println(rb.getString(SqltoolRB.REJECTREPORT_ROW,
++                  new String[] {
++diff -crN hsqldb-old/src/org/hsqldb/util/SqlServerTransferHelper.java hsqldb/src/org/hsqldb/util/SqlServerTransferHelper.java
++*** hsqldb-old/src/org/hsqldb/util/SqlServerTransferHelper.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/SqlServerTransferHelper.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 42,49 ****
++   */
++  class SqlServerTransferHelper extends TransferHelper {
++  
++!     private boolean firstTinyintRow;
++!     private boolean firstSmallintRow;
++  
++      SqlServerTransferHelper() {
++          super();
++--- 42,49 ----
++   */
++  class SqlServerTransferHelper extends TransferHelper {
++  
++!     public boolean firstTinyintRow;
++!     public boolean firstSmallintRow;
++  
++      SqlServerTransferHelper() {
++          super();
++diff -crN hsqldb-old/src/org/hsqldb/util/SqlTool.java hsqldb/src/org/hsqldb/util/SqlTool.java
++*** hsqldb-old/src/org/hsqldb/util/SqlTool.java	2007-07-09 10:51:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/SqlTool.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 62,71 ****
++   * @author Blaine Simpson unsaved@users
++   */
++  public class SqlTool {
++!     private static final String DEFAULT_RCFILE =
++          System.getProperty("user.home") + "/sqltool.rc";
++      // N.b. the following is static!
++!     private static String  revnum = null;
++  
++      public static final int SQLTOOLERR_EXITVAL = 1;
++      public static final int SYNTAXERR_EXITVAL = 11;
++--- 62,71 ----
++   * @author Blaine Simpson unsaved@users
++   */
++  public class SqlTool {
++!     public static final String DEFAULT_RCFILE =
++          System.getProperty("user.home") + "/sqltool.rc";
++      // N.b. the following is static!
++!     public static String  revnum = null;
++  
++      public static final int SQLTOOLERR_EXITVAL = 1;
++      public static final int SYNTAXERR_EXITVAL = 11;
++***************
++*** 80,87 ****
++       * The configuration identifier to use when connection parameters are
++       * specified on the command line
++       */
++!     private static String CMDLINE_ID = "cmdline";
++!     static private SqltoolRB rb = null;
++      // Must use a shared static RB object, since we need to get messages
++      // inside of static methods.
++      // This means that the locale will be set the first time this class
++--- 80,87 ----
++       * The configuration identifier to use when connection parameters are
++       * specified on the command line
++       */
++!     public static String CMDLINE_ID = "cmdline";
++!     static public SqltoolRB rb = null;
++      // Must use a shared static RB object, since we need to get messages
++      // inside of static methods.
++      // This means that the locale will be set the first time this class
++***************
++*** 106,123 ****
++      public static String LS = System.getProperty("line.separator");
++  
++      /** Utility nested class for internal use. */
++!     private static class BadCmdline extends Exception {
++          static final long serialVersionUID = -2134764796788108325L;
++          BadCmdline() {}
++      }
++  
++      /** Utility object for internal use. */
++!     private static BadCmdline bcl = new BadCmdline();
++  
++      /** For trapping of exceptions inside this class.
++       * These are always handled inside this class.
++       */
++!     private static class PrivateException extends Exception {
++          static final long serialVersionUID = -7765061479594523462L;
++  
++          PrivateException() {
++--- 106,123 ----
++      public static String LS = System.getProperty("line.separator");
++  
++      /** Utility nested class for internal use. */
++!     public static class BadCmdline extends Exception {
++          static final long serialVersionUID = -2134764796788108325L;
++          BadCmdline() {}
++      }
++  
++      /** Utility object for internal use. */
++!     public static BadCmdline bcl = new BadCmdline();
++  
++      /** For trapping of exceptions inside this class.
++       * These are always handled inside this class.
++       */
++!     public static class PrivateException extends Exception {
++          static final long serialVersionUID = -7765061479594523462L;
++  
++          PrivateException() {
++***************
++*** 152,158 ****
++       * @param username The user the password is for
++       * @return The password the user entered
++       */
++!     private static String promptForPassword(String username)
++      throws PrivateException {
++  
++          BufferedReader console;
++--- 152,158 ----
++       * @param username The user the password is for
++       * @return The password the user entered
++       */
++!     public static String promptForPassword(String username)
++      throws PrivateException {
++  
++          BufferedReader console;
++***************
++*** 191,197 ****
++       * @param lowerCaseKeys Set to <code>true</code> if the map keys should be
++       *        converted to lower case
++       */
++!     private static void varParser(String varString, Map varMap,
++                                    boolean lowerCaseKeys)
++                                    throws PrivateException {
++  
++--- 191,197 ----
++       * @param lowerCaseKeys Set to <code>true</code> if the map keys should be
++       *        converted to lower case
++       */
++!     public static void varParser(String varString, Map varMap,
++                                    boolean lowerCaseKeys)
++                                    throws PrivateException {
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/SqltoolRB.java hsqldb/src/org/hsqldb/util/SqltoolRB.java
++*** hsqldb-old/src/org/hsqldb/util/SqltoolRB.java	2007-10-11 11:32:18.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/SqltoolRB.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 106,112 ****
++                  rb1.getString(SqltoolRB.JDBC_ESTABLISHED, new String[] {}));
++      }
++  
++!     static private int keyCounter = 0;
++      static public final int SQLTOOL_SYNTAX = keyCounter++;
++      static public final int PASSWORDFOR_PROMPT = keyCounter++;
++      static public final int SQLTOOL_VARSET_BADFORMAT = keyCounter++;
++--- 106,112 ----
++                  rb1.getString(SqltoolRB.JDBC_ESTABLISHED, new String[] {}));
++      }
++  
++!     static public int keyCounter = 0;
++      static public final int SQLTOOL_SYNTAX = keyCounter++;
++      static public final int PASSWORDFOR_PROMPT = keyCounter++;
++      static public final int SQLTOOL_VARSET_BADFORMAT = keyCounter++;
++***************
++*** 283,289 ****
++      static public final int DSV_REJECTREPORT_PURGEFAIL = keyCounter++;
++      static public final int EDIT_MALFORMAT = keyCounter++;
++  
++!     private static Object[] memberKeyArray = new Object[] {
++          /* With Java 5, can use auto-boxing and get rid of all of the
++           * Integer instantiations below.*/
++          // SqlTool class, file references:
++--- 283,289 ----
++      static public final int DSV_REJECTREPORT_PURGEFAIL = keyCounter++;
++      static public final int EDIT_MALFORMAT = keyCounter++;
++  
++!     public static Object[] memberKeyArray = new Object[] {
++          /* With Java 5, can use auto-boxing and get rid of all of the
++           * Integer instantiations below.*/
++          // SqlTool class, file references:
++***************
++*** 469,477 ****
++          new Integer(EDIT_MALFORMAT), "edit.malformat",
++      };
++  
++!     private Map keyIdToString = new HashMap();
++  
++!     protected Map getKeyIdToString() {
++          return keyIdToString;
++      }
++  
++--- 469,477 ----
++          new Integer(EDIT_MALFORMAT), "edit.malformat",
++      };
++  
++!     public Map keyIdToString = new HashMap();
++  
++!     public Map getKeyIdToString() {
++          return keyIdToString;
++      }
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/SqlToolSprayer.java hsqldb/src/org/hsqldb/util/SqlToolSprayer.java
++*** hsqldb-old/src/org/hsqldb/util/SqlToolSprayer.java	2007-06-21 10:49:20.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/SqlToolSprayer.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 60,66 ****
++  public class SqlToolSprayer {
++  
++      public static String LS = System.getProperty("line.separator");
++!     private static String SYNTAX_MSG =
++          "SYNTAX:  java [-D...] SqlToolSprayer 'SQL;' [urlid1 urlid2...]\n"
++          + "System properties you may use [default values]:\n"
++          + "    sqltoolsprayer.period (in ms.) [500]\n"
++--- 60,66 ----
++  public class SqlToolSprayer {
++  
++      public static String LS = System.getProperty("line.separator");
++!     public static String SYNTAX_MSG =
++          "SYNTAX:  java [-D...] SqlToolSprayer 'SQL;' [urlid1 urlid2...]\n"
++          + "System properties you may use [default values]:\n"
++          + "    sqltoolsprayer.period (in ms.) [500]\n"
++***************
++*** 186,192 ****
++          System.exit(0);
++      }
++  
++!     private static void getUrlsFromPropFile(String fileName,
++              ArrayList al) throws Exception {
++  
++          Properties p = new Properties();
++--- 186,192 ----
++          System.exit(0);
++      }
++  
++!     public static void getUrlsFromPropFile(String fileName,
++              ArrayList al) throws Exception {
++  
++          Properties p = new Properties();
++diff -crN hsqldb-old/src/org/hsqldb/util/TableSorter.java hsqldb/src/org/hsqldb/util/TableSorter.java
++*** hsqldb-old/src/org/hsqldb/util/TableSorter.java	2004-11-25 01:07:20.000000000 +0100
++--- hsqldb/src/org/hsqldb/util/TableSorter.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 78,88 ****
++   */
++  public class TableSorter extends AbstractTableModel {
++  
++!     protected TableModel           tableModel;
++      public static final int        DESCENDING            = -1;
++      public static final int        NOT_SORTED            = 0;
++      public static final int        ASCENDING             = 1;
++!     private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
++      public static final Comparator COMPARABLE_COMPARATOR = new Comparator() {
++  
++          public int compare(Object o1, Object o2) {
++--- 78,88 ----
++   */
++  public class TableSorter extends AbstractTableModel {
++  
++!     public TableModel           tableModel;
++      public static final int        DESCENDING            = -1;
++      public static final int        NOT_SORTED            = 0;
++      public static final int        ASCENDING             = 1;
++!     public static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
++      public static final Comparator COMPARABLE_COMPARATOR = new Comparator() {
++  
++          public int compare(Object o1, Object o2) {
++***************
++*** 112,124 ****
++              return o1.toString().compareTo(o2.toString());
++          }
++      };
++!     private Row[]              viewToModel;
++!     private int[]              modelToView;
++!     private JTableHeader       tableHeader;
++!     private MouseListener      mouseListener;
++!     private TableModelListener tableModelListener;
++!     private Map                columnComparators = new HashMap();
++!     private List               sortingColumns    = new ArrayList();
++  
++      public TableSorter() {
++          this.mouseListener      = new MouseHandler();
++--- 112,124 ----
++              return o1.toString().compareTo(o2.toString());
++          }
++      };
++!     public Row[]              viewToModel;
++!     public int[]              modelToView;
++!     public JTableHeader       tableHeader;
++!     public MouseListener      mouseListener;
++!     public TableModelListener tableModelListener;
++!     public Map                columnComparators = new HashMap();
++!     public List               sortingColumns    = new ArrayList();
++  
++      public TableSorter() {
++          this.mouseListener      = new MouseHandler();
++***************
++*** 140,146 ****
++          setTableModel(tableModel);
++      }
++  
++!     private void clearSortingState() {
++          viewToModel = null;
++          modelToView = null;
++      }
++--- 140,146 ----
++          setTableModel(tableModel);
++      }
++  
++!     public void clearSortingState() {
++          viewToModel = null;
++          modelToView = null;
++      }
++***************
++*** 198,204 ****
++          return sortingColumns.size() != 0;
++      }
++  
++!     private Directive getDirective(int column) {
++  
++          for (int i = 0; i < sortingColumns.size(); i++) {
++              Directive directive = (Directive) sortingColumns.get(i);
++--- 198,204 ----
++          return sortingColumns.size() != 0;
++      }
++  
++!     public Directive getDirective(int column) {
++  
++          for (int i = 0; i < sortingColumns.size(); i++) {
++              Directive directive = (Directive) sortingColumns.get(i);
++***************
++*** 215,221 ****
++          return getDirective(column).direction;
++      }
++  
++!     private void sortingStatusChanged() {
++  
++          clearSortingState();
++          fireTableDataChanged();
++--- 215,221 ----
++          return getDirective(column).direction;
++      }
++  
++!     public void sortingStatusChanged() {
++  
++          clearSortingState();
++          fireTableDataChanged();
++***************
++*** 240,246 ****
++          sortingStatusChanged();
++      }
++  
++!     protected Icon getHeaderRendererIcon(int column, int size) {
++  
++          Directive directive = getDirective(column);
++  
++--- 240,246 ----
++          sortingStatusChanged();
++      }
++  
++!     public Icon getHeaderRendererIcon(int column, int size) {
++  
++          Directive directive = getDirective(column);
++  
++***************
++*** 252,258 ****
++                           sortingColumns.indexOf(directive));
++      }
++  
++!     private void cancelSorting() {
++          sortingColumns.clear();
++          sortingStatusChanged();
++      }
++--- 252,258 ----
++                           sortingColumns.indexOf(directive));
++      }
++  
++!     public void cancelSorting() {
++          sortingColumns.clear();
++          sortingStatusChanged();
++      }
++***************
++*** 266,272 ****
++          }
++      }
++  
++!     protected Comparator getComparator(int column) {
++  
++          Class columnType = tableModel.getColumnClass(column);
++          Comparator comparator =
++--- 266,272 ----
++          }
++      }
++  
++!     public Comparator getComparator(int column) {
++  
++          Class columnType = tableModel.getColumnClass(column);
++          Comparator comparator =
++***************
++*** 283,289 ****
++          return LEXICAL_COMPARATOR;
++      }
++  
++!     private Row[] getViewToModel() {
++  
++          if (viewToModel == null) {
++              int tableModelRowCount = tableModel.getRowCount();
++--- 283,289 ----
++          return LEXICAL_COMPARATOR;
++      }
++  
++!     public Row[] getViewToModel() {
++  
++          if (viewToModel == null) {
++              int tableModelRowCount = tableModel.getRowCount();
++***************
++*** 306,312 ****
++          return getViewToModel()[viewIndex].modelIndex;
++      }
++  
++!     private int[] getModelToView() {
++  
++          if (modelToView == null) {
++              int n = getViewToModel().length;
++--- 306,312 ----
++          return getViewToModel()[viewIndex].modelIndex;
++      }
++  
++!     public int[] getModelToView() {
++  
++          if (modelToView == null) {
++              int n = getViewToModel().length;
++***************
++*** 353,361 ****
++      }
++  
++      // Helper classes
++!     private class Row implements Comparable {
++  
++!         private int modelIndex;
++  
++          public Row(int index) {
++              this.modelIndex = index;
++--- 353,361 ----
++      }
++  
++      // Helper classes
++!     public class Row implements Comparable {
++  
++!         public int modelIndex;
++  
++          public Row(int index) {
++              this.modelIndex = index;
++***************
++*** 394,400 ****
++          }
++      }
++  
++!     private class TableModelHandler implements TableModelListener {
++  
++          public void tableChanged(TableModelEvent e) {
++  
++--- 394,400 ----
++          }
++      }
++  
++!     public class TableModelHandler implements TableModelListener {
++  
++          public void tableChanged(TableModelEvent e) {
++  
++***************
++*** 457,463 ****
++          }
++      }
++  
++!     private class MouseHandler extends MouseAdapter {
++  
++          public void mouseClicked(MouseEvent e) {
++  
++--- 457,463 ----
++          }
++      }
++  
++!     public class MouseHandler extends MouseAdapter {
++  
++          public void mouseClicked(MouseEvent e) {
++  
++***************
++*** 484,494 ****
++          }
++      }
++  
++!     private static class Arrow implements Icon {
++  
++!         private boolean descending;
++!         private int     size;
++!         private int     priority;
++  
++          public Arrow(boolean descending, int size, int priority) {
++  
++--- 484,494 ----
++          }
++      }
++  
++!     public static class Arrow implements Icon {
++  
++!         public boolean descending;
++!         public int     size;
++!         public int     priority;
++  
++          public Arrow(boolean descending, int size, int priority) {
++  
++***************
++*** 548,556 ****
++          }
++      }
++  
++!     private class SortableHeaderRenderer implements TableCellRenderer {
++  
++!         private TableCellRenderer tableCellRenderer;
++  
++          public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
++              this.tableCellRenderer = tableCellRenderer;
++--- 548,556 ----
++          }
++      }
++  
++!     public class SortableHeaderRenderer implements TableCellRenderer {
++  
++!         public TableCellRenderer tableCellRenderer;
++  
++          public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
++              this.tableCellRenderer = tableCellRenderer;
++***************
++*** 579,588 ****
++          }
++      }
++  
++!     private static class Directive {
++  
++!         private int column;
++!         private int direction;
++  
++          public Directive(int column, int direction) {
++              this.column    = column;
++--- 579,588 ----
++          }
++      }
++  
++!     public static class Directive {
++  
++!         public int column;
++!         public int direction;
++  
++          public Directive(int column, int direction) {
++              this.column    = column;
++diff -crN hsqldb-old/src/org/hsqldb/util/TransferCommon.java hsqldb/src/org/hsqldb/util/TransferCommon.java
++*** hsqldb-old/src/org/hsqldb/util/TransferCommon.java	2006-07-27 22:04:30.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/TransferCommon.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 155,159 ****
++          return (tTable);
++      }
++  
++!     private TransferCommon() {}
++  }
++--- 155,159 ----
++          return (tTable);
++      }
++  
++!     public TransferCommon() {}
++  }
++diff -crN hsqldb-old/src/org/hsqldb/util/TransferDb.java hsqldb/src/org/hsqldb/util/TransferDb.java
++*** hsqldb-old/src/org/hsqldb/util/TransferDb.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/TransferDb.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 55,61 ****
++  
++      Connection          conn;
++      DatabaseMetaData    meta;
++!     protected Statement srcStatement = null;
++  
++      TransferDb(Connection c, Traceable t) throws DataAccessPointException {
++  
++--- 55,61 ----
++  
++      Connection          conn;
++      DatabaseMetaData    meta;
++!     public Statement srcStatement = null;
++  
++      TransferDb(Connection c, Traceable t) throws DataAccessPointException {
++  
++***************
++*** 243,249 ****
++      }
++  
++  /*
++!     private void transferRow(TransferResultSet r,
++                               PreparedStatement p)
++                               throws DataAccessPointException, SQLException {
++          // TODO
++--- 243,249 ----
++      }
++  
++  /*
++!     public void transferRow(TransferResultSet r,
++                               PreparedStatement p)
++                               throws DataAccessPointException, SQLException {
++          // TODO
++***************
++*** 904,910 ****
++       *
++       * @throws SQLException
++       */
++!     private void transferRow(TransferResultSet r, PreparedStatement p,
++                               int len,
++                               int[] types)
++                               throws DataAccessPointException, SQLException {
++--- 904,910 ----
++       *
++       * @throws SQLException
++       */
++!     public void transferRow(TransferResultSet r, PreparedStatement p,
++                               int len,
++                               int[] types)
++                               throws DataAccessPointException, SQLException {
++diff -crN hsqldb-old/src/org/hsqldb/util/TransferHelper.java hsqldb/src/org/hsqldb/util/TransferHelper.java
++*** hsqldb-old/src/org/hsqldb/util/TransferHelper.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/TransferHelper.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 44,54 ****
++   */
++  class TransferHelper {
++  
++!     protected TransferDb db;
++!     protected Traceable  tracer;
++!     protected String     sSchema;
++!     protected JDBCTypes  JDBCT;
++!     private String       quote;
++  
++      TransferHelper() {
++  
++--- 44,54 ----
++   */
++  class TransferHelper {
++  
++!     public TransferDb db;
++!     public Traceable  tracer;
++!     public String     sSchema;
++!     public JDBCTypes  JDBCT;
++!     public String       quote;
++  
++      TransferHelper() {
++  
++diff -crN hsqldb-old/src/org/hsqldb/util/Transfer.java hsqldb/src/org/hsqldb/util/Transfer.java
++*** hsqldb-old/src/org/hsqldb/util/Transfer.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/Transfer.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 204,210 ****
++          work(arg);
++      }
++  
++!     private boolean CatalogToSelect() {
++  
++          Vector result = null;
++  
++--- 204,210 ----
++          work(arg);
++      }
++  
++!     public boolean CatalogToSelect() {
++  
++          Vector result = null;
++  
++***************
++*** 284,290 ****
++          return (lTable.getItemCount() > 0);
++      }
++  
++!     private boolean SchemaToSelect() {
++  
++          Vector result = null;
++  
++--- 284,290 ----
++          return (lTable.getItemCount() > 0);
++      }
++  
++!     public boolean SchemaToSelect() {
++  
++          Vector result = null;
++  
++***************
++*** 491,497 ****
++          return;
++      }
++  
++!     private void RefreshMainDisplay() {
++  
++          lTable.removeAll();
++          lTable.repaint();
++--- 491,497 ----
++          return;
++      }
++  
++!     public void RefreshMainDisplay() {
++  
++          lTable.removeAll();
++          lTable.repaint();
++***************
++*** 531,537 ****
++       * @param f
++       * @param m
++       */
++!     private void addMenuItems(Menu f, String[] m) {
++  
++          for (int i = 0; i < m.length; i++) {
++              if (m[i].equals("-")) {
++--- 531,537 ----
++       * @param f
++       * @param m
++       */
++!     public void addMenuItems(Menu f, String[] m) {
++  
++          for (int i = 0; i < m.length; i++) {
++              if (m[i].equals("-")) {
++***************
++*** 586,592 ****
++       * Method declaration
++       *
++       */
++!     private void saveTable() {
++  
++          if (tCurrent == null) {
++              return;
++--- 586,592 ----
++       * Method declaration
++       *
++       */
++!     public void saveTable() {
++  
++          if (tCurrent == null) {
++              return;
++***************
++*** 644,650 ****
++       *
++       * @param t
++       */
++!     private void displayTable(TransferTable t) {
++  
++          tCurrent = t;
++  
++--- 644,650 ----
++       *
++       * @param t
++       */
++!     public void displayTable(TransferTable t) {
++  
++          tCurrent = t;
++  
++***************
++*** 680,686 ****
++       *
++       * @param and
++       */
++!     private void updateEnabled(boolean and) {
++  
++          boolean b = cTransfer.getState();
++  
++--- 680,686 ----
++       *
++       * @param and
++       */
++!     public void updateEnabled(boolean and) {
++  
++          boolean b = cTransfer.getState();
++  
++***************
++*** 712,718 ****
++      /**
++       * Method ProcessNextStep
++       */
++!     private void ProcessNextStep() {
++  
++          switch (iSelectionStep) {
++  
++--- 712,718 ----
++      /**
++       * Method ProcessNextStep
++       */
++!     public void ProcessNextStep() {
++  
++          switch (iSelectionStep) {
++  
++***************
++*** 902,908 ****
++       */
++      public void windowClosed(WindowEvent e) {}
++  
++!     private void cleanup() {
++  
++          try {
++              if (sourceDb != null) {
++--- 902,908 ----
++       */
++      public void windowClosed(WindowEvent e) {}
++  
++!     public void cleanup() {
++  
++          try {
++              if (sourceDb != null) {
++***************
++*** 958,964 ****
++       * Method declaration
++       *
++       */
++!     private void initGUI() {
++  
++          Font fFont = new Font("Dialog", Font.PLAIN, 12);
++  
++--- 958,964 ----
++       * Method declaration
++       *
++       */
++!     public void initGUI() {
++  
++          Font fFont = new Font("Dialog", Font.PLAIN, 12);
++  
++***************
++*** 1120,1126 ****
++       *
++       * @return
++       */
++!     private Panel createBorderPanel(Component center) {
++  
++          Panel p = new Panel();
++  
++--- 1120,1126 ----
++       *
++       * @return
++       */
++!     public Panel createBorderPanel(Component center) {
++  
++          Panel p = new Panel();
++  
++***************
++*** 1143,1149 ****
++       *
++       * @return
++       */
++!     private Label createLabel(String s) {
++  
++          Label l = new Label(s);
++  
++--- 1143,1149 ----
++       *
++       * @return
++       */
++!     public Label createLabel(String s) {
++  
++          Label l = new Label(s);
++  
++***************
++*** 1152,1163 ****
++          return l;
++      }
++  
++!     private void SavePrefs(String f) {
++          saveTable();
++          TransferCommon.savePrefs(f, sourceDb, targetDb, this, tTable);
++      }
++  
++!     private void LoadPrefs(String f) {
++  
++          TransferTable t;
++  
++--- 1152,1163 ----
++          return l;
++      }
++  
++!     public void SavePrefs(String f) {
++          saveTable();
++          TransferCommon.savePrefs(f, sourceDb, targetDb, this, tTable);
++      }
++  
++!     public void LoadPrefs(String f) {
++  
++          TransferTable t;
++  
++***************
++*** 1208,1214 ****
++       * Method declaration
++       *
++       */
++!     private void transfer() {
++  
++          saveTable();
++          updateEnabled(false);
++--- 1208,1214 ----
++       * Method declaration
++       *
++       */
++!     public void transfer() {
++  
++          saveTable();
++          updateEnabled(false);
++***************
++*** 1271,1277 ****
++          System.gc();
++      }
++  
++!     protected void Exit() {
++  
++          cleanup();
++          fMain.dispose();
++--- 1271,1277 ----
++          System.gc();
++      }
++  
++!     public void Exit() {
++  
++          cleanup();
++          fMain.dispose();
++diff -crN hsqldb-old/src/org/hsqldb/util/TransferSQLText.java hsqldb/src/org/hsqldb/util/TransferSQLText.java
++*** hsqldb-old/src/org/hsqldb/util/TransferSQLText.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/TransferSQLText.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 52,60 ****
++      String              sFileName              = null;
++      BufferedWriter      WTextWrite             = null;
++      BufferedReader      WTextRead              = null;
++!     protected boolean   StructureAlreadyParsed = false;
++      Hashtable           DbStmts                = null;
++!     protected JDBCTypes JDBCT                  = null;
++  
++      TransferSQLText(String _FileName,
++                      Traceable t) throws DataAccessPointException {
++--- 52,60 ----
++      String              sFileName              = null;
++      BufferedWriter      WTextWrite             = null;
++      BufferedReader      WTextRead              = null;
++!     public boolean   StructureAlreadyParsed = false;
++      Hashtable           DbStmts                = null;
++!     public JDBCTypes JDBCT                  = null;
++  
++      TransferSQLText(String _FileName,
++                      Traceable t) throws DataAccessPointException {
++***************
++*** 159,165 ****
++       *
++       * @throws SQLException
++       */
++!     private void transferRow(TransferResultSet r) throws Exception {
++  
++          String sLast = "";
++          int    len   = r.getColumnCount();
++--- 159,165 ----
++       *
++       * @throws SQLException
++       */
++!     public void transferRow(TransferResultSet r) throws Exception {
++  
++          String sLast = "";
++          int    len   = r.getColumnCount();
++diff -crN hsqldb-old/src/org/hsqldb/util/TransferTable.java hsqldb/src/org/hsqldb/util/TransferTable.java
++*** hsqldb-old/src/org/hsqldb/util/TransferTable.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/TransferTable.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 471,477 ****
++          }
++      }
++  
++!     private void initTypes() throws SQLException {
++  
++          if (hTypes != null) {
++              return;
++--- 471,477 ----
++          }
++      }
++  
++!     public void initTypes() throws SQLException {
++  
++          if (hTypes != null) {
++              return;
++diff -crN hsqldb-old/src/org/hsqldb/util/Tree.java hsqldb/src/org/hsqldb/util/Tree.java
++*** hsqldb-old/src/org/hsqldb/util/Tree.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/Tree.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 89,118 ****
++  class Tree extends Panel {
++  
++      // static
++!     private static Font        fFont;
++!     private static FontMetrics fMetrics;
++!     private static int         iRowHeight;
++!     private static int         iIndentWidth;
++!     private int                iMaxTextLength;
++  
++      // drawing
++!     private Dimension dMinimum;
++!     private Graphics  gImage;
++!     private Image     iImage;
++  
++      // height / width
++!     private int iWidth, iHeight;
++!     private int iFirstRow;
++!     private int iTreeWidth, iTreeHeight;
++!     private int iX, iY;
++  
++      // data
++!     private Vector vData;
++!     private int    iRowCount;
++  
++      // scrolling
++!     private Scrollbar sbHoriz, sbVert;
++!     private int       iSbWidth, iSbHeight;
++  
++      static {
++          fFont        = new Font("Dialog", Font.PLAIN, 12);
++--- 89,118 ----
++  class Tree extends Panel {
++  
++      // static
++!     public static Font        fFont;
++!     public static FontMetrics fMetrics;
++!     public static int         iRowHeight;
++!     public static int         iIndentWidth;
++!     public int                iMaxTextLength;
++  
++      // drawing
++!     public Dimension dMinimum;
++!     public Graphics  gImage;
++!     public Image     iImage;
++  
++      // height / width
++!     public int iWidth, iHeight;
++!     public int iFirstRow;
++!     public int iTreeWidth, iTreeHeight;
++!     public int iX, iY;
++  
++      // data
++!     public Vector vData;
++!     public int    iRowCount;
++  
++      // scrolling
++!     public Scrollbar sbHoriz, sbVert;
++!     public int       iSbWidth, iSbHeight;
++  
++      static {
++          fFont        = new Font("Dialog", Font.PLAIN, 12);
++***************
++*** 544,550 ****
++       *
++       * @return
++       */
++!     private static int getMaxHeight(FontMetrics f) {
++          return f.getHeight() + 2;
++      }
++  }
++--- 544,550 ----
++       *
++       * @return
++       */
++!     public static int getMaxHeight(FontMetrics f) {
++          return f.getHeight() + 2;
++      }
++  }
++diff -crN hsqldb-old/src/org/hsqldb/util/ValidatingResourceBundle.java hsqldb/src/org/hsqldb/util/ValidatingResourceBundle.java
++*** hsqldb-old/src/org/hsqldb/util/ValidatingResourceBundle.java	2007-10-19 22:16:44.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ValidatingResourceBundle.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 50,57 ****
++   * See SqltoolRB for an example implementation of this abstract class.
++   */
++  abstract public class ValidatingResourceBundle {
++!     protected boolean validated = false;
++!     abstract protected Map getKeyIdToString();
++  
++      public static final int THROW_BEHAVIOR =
++              RefCapablePropertyResourceBundle.THROW_BEHAVIOR;
++--- 50,57 ----
++   * See SqltoolRB for an example implementation of this abstract class.
++   */
++  abstract public class ValidatingResourceBundle {
++!     public boolean validated = false;
++!     abstract public Map getKeyIdToString();
++  
++      public static final int THROW_BEHAVIOR =
++              RefCapablePropertyResourceBundle.THROW_BEHAVIOR;
++***************
++*** 63,71 ****
++       * details of RefCapablePropertyResourceBundle (and they won't need
++       * to code that God-awfully-long class name). */
++  
++!     protected RefCapablePropertyResourceBundle wrappedRCPRB;
++  
++!     protected ValidatingResourceBundle(String baseName) {
++          wrappedRCPRB = RefCapablePropertyResourceBundle.getBundle(baseName,
++                  getClass().getClassLoader());
++      }
++--- 63,71 ----
++       * details of RefCapablePropertyResourceBundle (and they won't need
++       * to code that God-awfully-long class name). */
++  
++!     public RefCapablePropertyResourceBundle wrappedRCPRB;
++  
++!     public ValidatingResourceBundle(String baseName) {
++          wrappedRCPRB = RefCapablePropertyResourceBundle.getBundle(baseName,
++                  getClass().getClassLoader());
++      }
++***************
++*** 98,105 ****
++                  missingPropertyBehavior, missingPosValueBehavior);
++      }
++  
++!     private int missingPropertyBehavior = THROW_BEHAVIOR;
++!     private int missingPosValueBehavior = THROW_BEHAVIOR;
++  
++      /**
++       * Set behavior for get*String*() method when a referred-to
++--- 98,105 ----
++                  missingPropertyBehavior, missingPosValueBehavior);
++      }
++  
++!     public int missingPropertyBehavior = THROW_BEHAVIOR;
++!     public int missingPosValueBehavior = THROW_BEHAVIOR;
++  
++      /**
++       * Set behavior for get*String*() method when a referred-to
++diff -crN hsqldb-old/src/org/hsqldb/util/ZaurusChoice.java hsqldb/src/org/hsqldb/util/ZaurusChoice.java
++*** hsqldb-old/src/org/hsqldb/util/ZaurusChoice.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ZaurusChoice.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 52,58 ****
++  // getContent() answers the value !!
++  public class ZaurusChoice extends Choice implements ZaurusComponent {
++  
++!     private static final int MaxLenInZChoice = 15;
++      Vector                   values;
++      int                      countChanges;
++  
++--- 52,58 ----
++  // getContent() answers the value !!
++  public class ZaurusChoice extends Choice implements ZaurusComponent {
++  
++!     public static final int MaxLenInZChoice = 15;
++      Vector                   values;
++      int                      countChanges;
++  
++***************
++*** 118,124 ****
++      }
++  
++      // find for a given value the index in values
++!     private int findValue(String s) {
++  
++          for (int i = 0; i < values.size(); i++) {
++              if (s.equals(values.elementAt(i))) {
++--- 118,124 ----
++      }
++  
++      // find for a given value the index in values
++!     public int findValue(String s) {
++  
++          for (int i = 0; i < values.size(); i++) {
++              if (s.equals(values.elementAt(i))) {
++diff -crN hsqldb-old/src/org/hsqldb/util/ZaurusConnectionDialog.java hsqldb/src/org/hsqldb/util/ZaurusConnectionDialog.java
++*** hsqldb-old/src/org/hsqldb/util/ZaurusConnectionDialog.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ZaurusConnectionDialog.java	2007-11-04 00:13:46.000000000 +0100
++***************
++*** 251,257 ****
++       *
++       *
++       */
++!     protected void finishCreate() {
++  
++          try {
++              mConnection = createConnection(mDriver.getText(), mURL.getText(),
++--- 251,257 ----
++       *
++       *
++       */
++!     public void finishCreate() {
++  
++          try {
++              mConnection = createConnection(mDriver.getText(), mURL.getText(),
++diff -crN hsqldb-old/src/org/hsqldb/util/ZaurusDatabaseManager.java hsqldb/src/org/hsqldb/util/ZaurusDatabaseManager.java
++*** hsqldb-old/src/org/hsqldb/util/ZaurusDatabaseManager.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ZaurusDatabaseManager.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 247,253 ****
++          m.connect(c);
++      }
++  
++!     private static void showUsage() {
++  
++          System.out.println(
++              "Usage: java org.hsqldb.util.ZaurusDatabaseManager [options]");
++--- 247,253 ----
++          m.connect(c);
++      }
++  
++!     public static void showUsage() {
++  
++          System.out.println(
++              "Usage: java org.hsqldb.util.ZaurusDatabaseManager [options]");
++***************
++*** 587,593 ****
++       * Method declaration
++       *
++       */
++!     private void initGUI() {
++  
++          Panel pQuery   = new Panel();
++          Panel pCommand = new Panel();
++--- 587,593 ----
++       * Method declaration
++       *
++       */
++!     public void initGUI() {
++  
++          Panel pQuery   = new Panel();
++          Panel pCommand = new Panel();
++***************
++*** 663,669 ****
++          fMain.pack();
++      }
++  
++!     protected void refreshTree() {
++          super.refreshTree();
++          eEditor.refresh(cConn);
++      }
++--- 663,669 ----
++          fMain.pack();
++      }
++  
++!     public void refreshTree() {
++          super.refreshTree();
++          eEditor.refresh(cConn);
++      }
++diff -crN hsqldb-old/src/org/hsqldb/util/ZaurusEditor.java hsqldb/src/org/hsqldb/util/ZaurusEditor.java
++*** hsqldb-old/src/org/hsqldb/util/ZaurusEditor.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ZaurusEditor.java	2007-11-04 00:14:06.000000000 +0100
++***************
++*** 401,407 ****
++          }
++      }
++  
++!     private void initGUI() {
++  
++          // without connection there are no tables
++          // vAllTables is a local variable with all table names in the database
++--- 401,407 ----
++          }
++      }
++  
++!     public void initGUI() {
++  
++          // without connection there are no tables
++          // vAllTables is a local variable with all table names in the database
++***************
++*** 565,575 ****
++  
++      // process the buttons events
++      // *******************************************************
++!     // private methods
++      // *******************************************************
++      // read all table names over the current database connection
++      // exclude tables without primary key
++!     private Vector getAllTables() {
++  
++          Vector result = new Vector(20);
++  
++--- 565,575 ----
++  
++      // process the buttons events
++      // *******************************************************
++!     // public methods
++      // *******************************************************
++      // read all table names over the current database connection
++      // exclude tables without primary key
++!     public Vector getAllTables() {
++  
++          Vector result = new Vector(20);
++  
++***************
++*** 608,614 ****
++  
++      // determine the index of the choosen table in Vector vHoldTableNames
++      // if the table name is not in vHoldTableNames, create a ZaurusTableForm for it
++!     private int getChoosenTableIndex() {
++  
++          String tableName = cTables.getSelectedItem();
++  
++--- 608,614 ----
++  
++      // determine the index of the choosen table in Vector vHoldTableNames
++      // if the table name is not in vHoldTableNames, create a ZaurusTableForm for it
++!     public int getChoosenTableIndex() {
++  
++          String tableName = cTables.getSelectedItem();
++  
++***************
++*** 633,639 ****
++  
++      // determine the index of the given tableName in Vector vHoldTableNames
++      // if the name is not in vHoldTableNames, answer -1
++!     private int getTableIndex(String tableName) {
++  
++          int index;
++  
++--- 633,639 ----
++  
++      // determine the index of the given tableName in Vector vHoldTableNames
++      // if the name is not in vHoldTableNames, answer -1
++!     public int getTableIndex(String tableName) {
++  
++          int index;
++  
++***************
++*** 650,656 ****
++      }
++  
++      // convert the search words in the textfield to an array of words
++!     private String[] getWords() {
++  
++          StringTokenizer tokenizer =
++              new StringTokenizer(fSearchWords.getText());
++--- 650,656 ----
++      }
++  
++      // convert the search words in the textfield to an array of words
++!     public String[] getWords() {
++  
++          StringTokenizer tokenizer =
++              new StringTokenizer(fSearchWords.getText());
++***************
++*** 665,671 ****
++      }
++  
++      // init the three boxes for buttons
++!     private void initButtons() {
++  
++          // the buttons for the search form
++          bSearchRow = new Button("Search Rows");
++--- 665,671 ----
++      }
++  
++      // init the three boxes for buttons
++!     public void initButtons() {
++  
++          // the buttons for the search form
++          bSearchRow = new Button("Search Rows");
++***************
++*** 722,728 ****
++  
++      // check whether the last button pressed was delete
++      // if so, clear status line and reset the flag
++!     private void resetLastButtonDelete() {
++  
++          if (lastButtonDelete) {
++              ZaurusEditor.printStatus("");
++--- 722,728 ----
++  
++      // check whether the last button pressed was delete
++      // if so, clear status line and reset the flag
++!     public void resetLastButtonDelete() {
++  
++          if (lastButtonDelete) {
++              ZaurusEditor.printStatus("");
++***************
++*** 732,738 ****
++      }
++  
++      // reset  everything after changes in the database
++!     private void resetTableForms() {
++  
++          lForm.show(pForm, "search");
++          lButton.show(pButton, "search");
++--- 732,738 ----
++      }
++  
++      // reset  everything after changes in the database
++!     public void resetTableForms() {
++  
++          lForm.show(pForm, "search");
++          lButton.show(pButton, "search");
++diff -crN hsqldb-old/src/org/hsqldb/util/ZaurusTableForm.java hsqldb/src/org/hsqldb/util/ZaurusTableForm.java
++*** hsqldb-old/src/org/hsqldb/util/ZaurusTableForm.java	2005-10-23 21:25:14.000000000 +0200
++--- hsqldb/src/org/hsqldb/util/ZaurusTableForm.java	2007-11-04 00:14:07.000000000 +0100
++***************
++*** 542,551 ****
++      }
++  
++      // ******************************************************
++!     // private methods
++      // ******************************************************
++      // set all fields for primary keys to not editable
++!     private void disablePKFields() {
++  
++          for (int i = 0; i < primaryKeys.length; i++) {
++              komponente[pkColIndex[i]].setEditable(false);
++--- 542,551 ----
++      }
++  
++      // ******************************************************
++!     // public methods
++      // ******************************************************
++      // set all fields for primary keys to not editable
++!     public void disablePKFields() {
++  
++          for (int i = 0; i < primaryKeys.length; i++) {
++              komponente[pkColIndex[i]].setEditable(false);
++***************
++*** 555,561 ****
++      // fetch all values from a table and a column
++      // fill the ZaurusChoice zc with the row values for the Choice
++      // and the column values as values
++!     private void fillZChoice(ZaurusChoice zc, String tab, String col) {
++  
++          try {
++              if (cConn == null) {
++--- 555,561 ----
++      // fetch all values from a table and a column
++      // fill the ZaurusChoice zc with the row values for the Choice
++      // and the column values as values
++!     public void fillZChoice(ZaurusChoice zc, String tab, String col) {
++  
++          try {
++              if (cConn == null) {
++***************
++*** 590,596 ****
++      }
++  
++      // fetch all column names
++!     private void fetchColumns() {
++  
++          Vector temp     = new Vector(20);
++          Vector tempType = new Vector(20);
++--- 590,596 ----
++      }
++  
++      // fetch all column names
++!     public void fetchColumns() {
++  
++          Vector temp     = new Vector(20);
++          Vector tempType = new Vector(20);
++***************
++*** 628,634 ****
++      }
++  
++      // fetch the imported keys i.e. columns which reference to foreign keys in other tables
++!     private void fetchImportedKeys() {
++  
++          Vector imKeys      = new Vector(20);
++          Vector imKeyNames  = null;
++--- 628,634 ----
++      }
++  
++      // fetch the imported keys i.e. columns which reference to foreign keys in other tables
++!     public void fetchImportedKeys() {
++  
++          Vector imKeys      = new Vector(20);
++          Vector imKeyNames  = null;
++***************
++*** 714,720 ****
++          }
++      }
++  
++!     private void fetchPrimaryKeys() {
++  
++          Vector temp = new Vector(20);
++  
++--- 714,720 ----
++          }
++      }
++  
++!     public void fetchPrimaryKeys() {
++  
++          Vector temp = new Vector(20);
++  
++***************
++*** 749,755 ****
++          }    // end of for (int i=0; i<primaryKeys.length; i++)
++      }
++  
++!     private String generatePKWhere() {
++  
++          String stmtString = " WHERE ";
++  
++--- 749,755 ----
++          }    // end of for (int i=0; i<primaryKeys.length; i++)
++      }
++  
++!     public String generatePKWhere() {
++  
++          String stmtString = " WHERE ";
++  
++***************
++*** 765,771 ****
++      }
++  
++      // generate the Where-condition for the words
++!     private String generateWhere(String[] words, boolean allWords,
++                                   boolean ignoreCase, boolean noMatchWhole) {
++  
++          String result = "";
++--- 765,771 ----
++      }
++  
++      // generate the Where-condition for the words
++!     public String generateWhere(String[] words, boolean allWords,
++                                   boolean ignoreCase, boolean noMatchWhole) {
++  
++          String result = "";
++***************
++*** 822,828 ****
++      }
++  
++      // answer the index of the column named name in the actual table
++!     private int getColIndex(String name) {
++  
++          for (int i = 0; i < columns.length; i++) {
++              if (name.equals(columns[i])) {
++--- 822,828 ----
++      }
++  
++      // answer the index of the column named name in the actual table
++!     public int getColIndex(String name) {
++  
++          for (int i = 0; i < columns.length; i++) {
++              if (name.equals(columns[i])) {
++***************
++*** 834,840 ****
++      }
++  
++      // answer the index of the column named colName in the table tabName
++!     private int getColIndex(String colName, String tabName) {
++  
++          int ordPos = 0;
++  
++--- 834,840 ----
++      }
++  
++      // answer the index of the column named colName in the table tabName
++!     public int getColIndex(String colName, String tabName) {
++  
++          int ordPos = 0;
++  
++***************
++*** 864,870 ****
++  
++      // answer the index of the constraint for the column index
++      // answer -1, if the column is not part of any constraint
++!     private int getConstraintIndex(int colIndex) {
++  
++          for (int i = 0; i < imColIndex.length; i++) {
++              for (int j = 0; j < imColIndex[i].length; j++) {
++--- 864,870 ----
++  
++      // answer the index of the constraint for the column index
++      // answer -1, if the column is not part of any constraint
++!     public int getConstraintIndex(int colIndex) {
++  
++          for (int i = 0; i < imColIndex.length; i++) {
++              for (int j = 0; j < imColIndex[i].length; j++) {
++***************
++*** 877,883 ****
++          return -1;
++      }
++  
++!     private void initGUI() {
++  
++          Panel pEntry = new Panel();
++  
++--- 877,883 ----
++          return -1;
++      }
++  
++!     public void initGUI() {
++  
++          Panel pEntry = new Panel();
++  
++***************
++*** 940,946 ****
++      }
++  
++      // get and show the values of the actual row in the GUI
++!     private void showAktRow() {
++  
++          try {
++              pStmt.clearParameters();
++--- 940,946 ----
++      }
++  
++      // get and show the values of the actual row in the GUI
++!     public void showAktRow() {
++  
++          try {
++              pStmt.clearParameters();
++diff -crN hsqldb-old/src/org/hsqldb/View.java hsqldb/src/org/hsqldb/View.java
++*** hsqldb-old/src/org/hsqldb/View.java	2007-07-23 20:42:26.000000000 +0200
++--- hsqldb/src/org/hsqldb/View.java	2007-11-04 00:14:09.000000000 +0100
++***************
++*** 50,57 ****
++  
++      Select             viewSelect;
++      SubQuery           viewSubQuery;
++!     private String     statement;
++!     private HsqlName[] colList;
++  
++      /** schema at the time of compilation */
++      HsqlName compileTimeSchema;
++--- 50,57 ----
++  
++      Select             viewSelect;
++      SubQuery           viewSubQuery;
++!     public String     statement;
++!     public HsqlName[] colList;
++  
++      /** schema at the time of compilation */
++      HsqlName compileTimeSchema;
++***************
++*** 159,167 ****
++      }
++  
++      /**
++!      *  is a private helper for replaceAsterisksInStatement, to avoid some code duplication
++       */
++!     private void collectAsteriskPos(final Select select,
++                                      HsqlArrayList asteriskPositions) {
++  
++          if (select.asteriskPositions == null) {
++--- 159,167 ----
++      }
++  
++      /**
++!      *  is a public helper for replaceAsterisksInStatement, to avoid some code duplication
++       */
++!     public void collectAsteriskPos(final Select select,
++                                      HsqlArrayList asteriskPositions) {
++  
++          if (select.asteriskPositions == null) {
++***************
++*** 184,190 ****
++       *  which reflects the structure of the underlying tables at the *time of the definition
++       *  of the view.
++       */
++!     private void replaceAsterisksInStatement() {
++  
++          HsqlArrayList asteriskPositions = new HsqlArrayList();
++  
++--- 184,190 ----
++       *  which reflects the structure of the underlying tables at the *time of the definition
++       *  of the view.
++       */
++!     public void replaceAsterisksInStatement() {
++  
++          HsqlArrayList asteriskPositions = new HsqlArrayList();
++  
++diff -crN hsqldb-old/src/org/hsqldb/WebServerConnection.java hsqldb/src/org/hsqldb/WebServerConnection.java
++*** hsqldb-old/src/org/hsqldb/WebServerConnection.java	2006-07-21 15:39:56.000000000 +0200
++--- hsqldb/src/org/hsqldb/WebServerConnection.java	2007-11-04 00:14:08.000000000 +0100
++***************
++*** 76,95 ****
++  class WebServerConnection implements Runnable {
++  
++      static final String         ENCODING = "8859_1";
++!     private Socket              socket;
++!     private WebServer           server;
++!     private static final int    REQUEST_TYPE_BAD  = 0;
++!     private static final int    REQUEST_TYPE_GET  = 1;
++!     private static final int    REQUEST_TYPE_HEAD = 2;
++!     private static final int    REQUEST_TYPE_POST = 3;
++!     private static final String HEADER_OK         = "HTTP/1.0 200 OK";
++!     private static final String HEADER_BAD_REQUEST =
++          "HTTP/1.0 400 Bad Request";
++!     private static final String HEADER_NOT_FOUND = "HTTP/1.0 404 Not Found";
++!     private static final String HEADER_FORBIDDEN = "HTTP/1.0 403 Forbidden";
++      static final int            BUFFER_SIZE      = 256;
++!     private RowOutputBinary     rowOut = new RowOutputBinary(BUFFER_SIZE);
++!     private RowInputBinary      rowIn            = new RowInputBinary(rowOut);
++  
++      //
++      static final byte[] BYTES_GET        = "GET".getBytes();
++--- 76,95 ----
++  class WebServerConnection implements Runnable {
++  
++      static final String         ENCODING = "8859_1";
++!     public Socket              socket;
++!     public WebServer           server;
++!     public static final int    REQUEST_TYPE_BAD  = 0;
++!     public static final int    REQUEST_TYPE_GET  = 1;
++!     public static final int    REQUEST_TYPE_HEAD = 2;
++!     public static final int    REQUEST_TYPE_POST = 3;
++!     public static final String HEADER_OK         = "HTTP/1.0 200 OK";
++!     public static final String HEADER_BAD_REQUEST =
++          "HTTP/1.0 400 Bad Request";
++!     public static final String HEADER_NOT_FOUND = "HTTP/1.0 404 Not Found";
++!     public static final String HEADER_FORBIDDEN = "HTTP/1.0 403 Forbidden";
++      static final int            BUFFER_SIZE      = 256;
++!     public RowOutputBinary     rowOut = new RowOutputBinary(BUFFER_SIZE);
++!     public RowInputBinary      rowIn            = new RowInputBinary(rowOut);
++  
++      //
++      static final byte[] BYTES_GET        = "GET".getBytes();
++***************
++*** 101,107 ****
++      };
++  
++      // default mime type mappings
++!     private static final int hnd_content_types =
++          BundleHandler.getBundleHandle("content-types", null);
++  
++      /**
++--- 101,107 ----
++      };
++  
++      // default mime type mappings
++!     public static final int hnd_content_types =
++          BundleHandler.getBundleHandle("content-types", null);
++  
++      /**
++***************
++*** 125,131 ****
++       * @return a best-guess mime-type string using the file extension
++       *      of the name argument.
++       */
++!     private String getMimeTypeString(String name) {
++  
++          int    pos;
++          String key;
++--- 125,131 ----
++       * @return a best-guess mime-type string using the file extension
++       *      of the name argument.
++       */
++!     public String getMimeTypeString(String name) {
++  
++          int    pos;
++          String key;
++***************
++*** 240,246 ****
++       * POST is used only for database access. So we can assume the strings
++       * are those generated by HTTPClientConnection
++       */
++!     private void processPost(InputStream inStream,
++                               String name) throws HsqlException, IOException {
++  
++          // fredt - parsing in this block is not actually necessary
++--- 240,246 ----
++       * POST is used only for database access. So we can assume the strings
++       * are those generated by HTTPClientConnection
++       */
++!     public void processPost(InputStream inStream,
++                               String name) throws HsqlException, IOException {
++  
++          // fredt - parsing in this block is not actually necessary
++***************
++*** 344,350 ****
++       * @param  name the name of the content to get
++       * @param  send whether to send the content as well, or just the header
++       */
++!     private void processGet(String name, boolean send) {
++  
++          try {
++              String       hdr;
++--- 344,350 ----
++       * @param  name the name of the content to get
++       * @param  send whether to send the content as well, or just the header
++       */
++!     public void processGet(String name, boolean send) {
++  
++          try {
++              String       hdr;
++***************
++*** 446,452 ****
++       *
++       * @param code the error condition code
++       */
++!     private void processError(int code) {
++  
++          String msg;
++  
++--- 446,452 ----
++       *
++       * @param code the error condition code
++       */
++!     public void processError(int code) {
++  
++          String msg;
++  
