db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r170069 [1/2] - in /incubator/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ engine/org/apache/derby/diag/ engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/iapi/sql/compile/ engine/org/apache/derby/iapi/types/ engine/org/apache/derby/impl/jdbc/ engine/org/apache/derby/impl/jdbc/authentication/ engine/org/apache/derby/impl/load/ engine/org/apache/derby/impl/sql/catalog/ engine/org/apache/derby/impl/sql/compile/ engine/org/apache/derby/impl/sql/conn/ engine/org/apache/derby/impl/sql/execute/ engine/org/apache/derby/impl/store/raw/data/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ testing/org/apache/derbyTesting/functionTests/tests/lang/ testing/org/apache/derbyTesting/functionTests/tests/store/
Date Fri, 13 May 2005 18:35:34 GMT
Author: bandaram
Date: Fri May 13 11:35:33 2005
New Revision: 170069

URL: http://svn.apache.org/viewcvs?rev=170069&view=rev
Log:
Derby-104. Increase ALL identifier lengths to 128.

Now all identifiers should have a max length of 128 (note: MAX_USERID_LENGTH is
unchanged).

What has been done:
1) Renamed DBLimit.java to Limits.java since it no longer contains
only DB2-compliant limits.
2) Changed DB2_MAX_IDENTIFIER_LENGTH18/30/128 to MAX_IDENTIFIER_LENGTH
and set it to 128
3) Updated the necessary tests and masters.
4) Extended lang/identifier.sql with positive and negative tests wrt
max id. length.


Fix submitted by Bernt Johnsen. (Bernt.Johnsen@Sun.COM)

Added:
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java
      - copied, changed from r169918, incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/DB2Limit.java
Removed:
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/DB2Limit.java
Modified:
    incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java
    incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorLogReader.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorMessages.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementCache.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementDuration.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByList.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetSchemaConstantAction.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dbMetaDataJdbc30.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/currentSchema.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/identifier.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/currentSchema.sql
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/identifier.sql
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn.java

Modified: incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java (original)
+++ incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java Fri May 13 11:35:33 2005
@@ -20,7 +20,7 @@
 
 package org.apache.derby.impl.drda;
 import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 /**
 	AppRequester stores information about the application requester.
@@ -232,12 +232,12 @@
 
 			case JCC_CLIENT:
 			case DNC_CLIENT:
-				return DB2Limit.DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH;
+				return Limits.DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH;
 			default:
 			// Default is the max for C clients, since that is more
 			// restricted than for JCC clients.  Note, though, that
 			// JCC clients are the only ones supported right now.
-				return DB2Limit.DB2_CCC_MAX_EXCEPTION_PARAM_LENGTH;
+				return Limits.DB2_CCC_MAX_EXCEPTION_PARAM_LENGTH;
 
 		}
 

Modified: incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java (original)
+++ incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java Fri May 13 11:35:33 2005
@@ -22,7 +22,7 @@
 import java.sql.Types;
 import org.apache.derby.iapi.reference.JDBC30Translation;
 import java.sql.SQLException;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 class FdocaConstants
 {
@@ -240,8 +240,8 @@
 	// their toString() method and their limit is 64K as well.
 	// BUT, that said, we ultimately have to match DB2's limit,
 	// so just use that...
-	protected static int LONGVARCHAR_MAX_LEN = DB2Limit.DB2_LONGVARCHAR_MAXWIDTH;
-	protected static int LONGVARBINARY_MAX_LEN = DB2Limit.DB2_LONGVARCHAR_MAXWIDTH;
+	protected static int LONGVARCHAR_MAX_LEN = Limits.DB2_LONGVARCHAR_MAXWIDTH;
+	protected static int LONGVARBINARY_MAX_LEN = Limits.DB2_LONGVARCHAR_MAXWIDTH;
 	protected static int LONGVARCHAR_LEN_NUMBYTES = 2;
 
 	// JCC  only supports a max precision of 31 like DB2

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorLogReader.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorLogReader.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorLogReader.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorLogReader.java Fri May 13 11:35:33 2005
@@ -33,7 +33,7 @@
 import java.sql.SQLException;
 import java.sql.Types;
 import org.apache.derby.vti.VTITemplate;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.util.StringUtil;
 
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
@@ -294,7 +294,7 @@
 				}
 				}
 
-				output = StringUtil.truncate(output, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+				output = StringUtil.truncate(output, Limits.DB2_VARCHAR_MAXWIDTH);
 
 				return output;
 
@@ -329,7 +329,7 @@
 		EmbedResultSetMetaData.getResultColumnDescriptor("LCCID", Types.VARCHAR, false, 15),
 		EmbedResultSetMetaData.getResultColumnDescriptor("DATABASE", Types.VARCHAR, false, 128),
 		EmbedResultSetMetaData.getResultColumnDescriptor("DRDAID", Types.VARCHAR, true, 50),
-		EmbedResultSetMetaData.getResultColumnDescriptor("LOGTEXT",Types.VARCHAR, false, DB2Limit.DB2_VARCHAR_MAXWIDTH)
+		EmbedResultSetMetaData.getResultColumnDescriptor("LOGTEXT",Types.VARCHAR, false, Limits.DB2_VARCHAR_MAXWIDTH)
 	};
 	private static final ResultSetMetaData metadata = new EmbedResultSetMetaData(columnInfo);
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorMessages.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorMessages.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorMessages.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/diag/ErrorMessages.java Fri May 13 11:35:33 2005
@@ -35,7 +35,7 @@
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.error.ExceptionSeverity;
 import org.apache.derby.iapi.services.i18n.MessageService;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.util.StringUtil;
 
 import org.apache.derby.vti.VTITemplate;
@@ -113,7 +113,7 @@
 		if (retCode) {
 		  SQLState =StandardException.getSQLStateFromIdentifier(k);
 		  message = MessageService.getTextMessage(k);
-		  message = StringUtil.truncate(message, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+		  message = StringUtil.truncate(message, Limits.DB2_VARCHAR_MAXWIDTH);
 		}
 		return retCode;
 	}
@@ -228,7 +228,7 @@
 	private static final ResultColumnDescriptor[] columnInfo = {
 
 		EmbedResultSetMetaData.getResultColumnDescriptor("SQL_STATE",  Types.VARCHAR, true, 5),
-		EmbedResultSetMetaData.getResultColumnDescriptor("MESSAGE",    Types.VARCHAR, true, DB2Limit.DB2_VARCHAR_MAXWIDTH),
+		EmbedResultSetMetaData.getResultColumnDescriptor("MESSAGE",    Types.VARCHAR, true, Limits.DB2_VARCHAR_MAXWIDTH),
 		EmbedResultSetMetaData.getResultColumnDescriptor("SEVERITY",   Types.INTEGER, true),
 	};
 	

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementCache.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementCache.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementCache.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementCache.java Fri May 13 11:35:33 2005
@@ -29,7 +29,7 @@
 
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
 import org.apache.derby.impl.jdbc.EmbedResultSetMetaData;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.util.StringUtil;
 
 import java.sql.Types;
@@ -147,7 +147,7 @@
 			return ((GenericStatement) currentPs.statement).getCompilationSchema();
 		case 3:
 			String sql = currentPs.getSource();
-			sql = StringUtil.truncate(sql, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+			sql = StringUtil.truncate(sql, Limits.DB2_VARCHAR_MAXWIDTH);
 			return sql;
 		default:
 			return null;
@@ -184,7 +184,7 @@
 
 		EmbedResultSetMetaData.getResultColumnDescriptor("ID",		  Types.CHAR, false, 36),
 		EmbedResultSetMetaData.getResultColumnDescriptor("SCHEMANAME",    Types.VARCHAR, true, 128),
-		EmbedResultSetMetaData.getResultColumnDescriptor("SQL_TEXT",  Types.VARCHAR, false, DB2Limit.DB2_VARCHAR_MAXWIDTH),
+		EmbedResultSetMetaData.getResultColumnDescriptor("SQL_TEXT",  Types.VARCHAR, false, Limits.DB2_VARCHAR_MAXWIDTH),
 		EmbedResultSetMetaData.getResultColumnDescriptor("UNICODE",   Types.BIT, false),
 		EmbedResultSetMetaData.getResultColumnDescriptor("VALID",  Types.BIT, false),
 		EmbedResultSetMetaData.getResultColumnDescriptor("COMPILED_AT",  Types.TIMESTAMP, true),

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementDuration.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementDuration.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementDuration.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/diag/StatementDuration.java Fri May 13 11:35:33 2005
@@ -36,7 +36,7 @@
 import org.apache.derby.vti.VTITemplate;
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
 import org.apache.derby.impl.jdbc.EmbedResultSetMetaData;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.util.StringUtil;
 
 /**
@@ -306,7 +306,7 @@
 				}
 				}
 
-				output = StringUtil.truncate(output, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+				output = StringUtil.truncate(output, Limits.DB2_VARCHAR_MAXWIDTH);
 
 
 				return output;
@@ -334,7 +334,7 @@
 		EmbedResultSetMetaData.getResultColumnDescriptor("THREADID",  Types.VARCHAR, false, 80),
 		EmbedResultSetMetaData.getResultColumnDescriptor("XID",       Types.VARCHAR, false, 15),
 		EmbedResultSetMetaData.getResultColumnDescriptor("LCCID",     Types.VARCHAR, false, 10),
-		EmbedResultSetMetaData.getResultColumnDescriptor("LOGTEXT",   Types.VARCHAR, true, DB2Limit.DB2_VARCHAR_MAXWIDTH),
+		EmbedResultSetMetaData.getResultColumnDescriptor("LOGTEXT",   Types.VARCHAR, true, Limits.DB2_VARCHAR_MAXWIDTH),
 		EmbedResultSetMetaData.getResultColumnDescriptor("DURATION",  Types.VARCHAR, false, 10),
 	};
 	

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java Fri May 13 11:35:33 2005
@@ -35,7 +35,7 @@
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
 import org.apache.derby.impl.jdbc.EmbedResultSetMetaData;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.util.StringUtil;
 
 import java.sql.ResultSetMetaData;
@@ -175,7 +175,7 @@
 		case 7:
 
 			str = info.getStatementTextString();
-			str = StringUtil.truncate(str, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+			str = StringUtil.truncate(str, Limits.DB2_VARCHAR_MAXWIDTH);
 			break;
 
 		default:
@@ -235,7 +235,7 @@
 		EmbedResultSetMetaData.getResultColumnDescriptor("TYPE",          Types.VARCHAR, false, 30),
 		EmbedResultSetMetaData.getResultColumnDescriptor("STATUS",        Types.VARCHAR, false, 8),
 		EmbedResultSetMetaData.getResultColumnDescriptor("FIRST_INSTANT", Types.VARCHAR, true,  20),
-		EmbedResultSetMetaData.getResultColumnDescriptor("SQL_TEXT",      Types.VARCHAR, true,  DB2Limit.DB2_VARCHAR_MAXWIDTH),
+		EmbedResultSetMetaData.getResultColumnDescriptor("SQL_TEXT",      Types.VARCHAR, true,  Limits.DB2_VARCHAR_MAXWIDTH),
 	};
 	
 	private static final ResultSetMetaData metadata = new EmbedResultSetMetaData(columnInfo);

Copied: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java (from r169918, incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/DB2Limit.java)
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java?p2=incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/DB2Limit.java&r1=169918&r2=170069&rev=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/DB2Limit.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java Fri May 13 11:35:33 2005
@@ -1,6 +1,6 @@
 /*
 
-   Derby - Class org.apache.derby.iapi.reference.DB2Limit
+   Derby - Class org.apache.derby.iapi.reference.Limits
 
    Copyright 2004 The Apache Software Foundation or its licensors, as applicable.
 
@@ -20,11 +20,11 @@
 
 package org.apache.derby.iapi.reference;
 
-public interface DB2Limit
+public interface Limits
 {
 	/**
-     * Various fixed numbers related to DB2 limits.
-     */
+        * Various fixed Limits. DB2 related limits are prefixed with "DB2_".
+        */
 
 	public static final int DB2_MAX_TRIGGER_RECURSION = 16; /* Maximum nesting level for triggers */
 
@@ -53,13 +53,11 @@
 	// SQLCAMESSAGE procedure. See org.apache.derby.impl.sql.catalog.
 	public static final int DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH = 2400;
 
-	/* Some identifiers like Constraint name, Cursor name, Function name, Index name, Trigger name
-	* are limited to 18 character in DB2*/
-	public static final int DB2_MAX_IDENTIFIER_LENGTH18 = 18;
-	/* Some identifiers like Column name, Schema name are limited to 30 characters in DB2*/
-	public static final int DB2_MAX_IDENTIFIER_LENGTH30 = 30;
-	/* Some identifiers like Savepoint names, Table names, view names etc are limited to 128 characters in DB2*/
-	public static final int DB2_MAX_IDENTIFIER_LENGTH128 = 128;
+        /* Identifiers (Constraint, Cursor, Function/Procedure, Index,
+         * Trigger, Column, Schema, Savepoint, Table and View names)
+         * are limited to 128 */ 
+        public static final int MAX_IDENTIFIER_LENGTH = 128;
+
 	public static final int	DB2_CHAR_MAXWIDTH = 254;
 	public static final int	DB2_VARCHAR_MAXWIDTH = 32672;
 	public static final int DB2_LOB_MAXWIDTH = 2147483647;
@@ -69,9 +67,9 @@
 	public static final int DB2_MAX_CHARACTER_LITERAL_LENGTH = 32672;
 	public static final int DB2_MAX_HEX_LITERAL_LENGTH = 16336;
 
-	public static final int MIN_COL_LENGTH_FOR_CURRENT_USER = 8;
-	public static final int MIN_COL_LENGTH_FOR_CURRENT_SCHEMA = 128;     
-	public static final int MAX_USERID_LENGTH = 30;
+	public static final int DB2_MIN_COL_LENGTH_FOR_CURRENT_USER = 8;
+	public static final int DB2_MIN_COL_LENGTH_FOR_CURRENT_SCHEMA = 128;     
+	public static final int DB2_MAX_USERID_LENGTH = 30;
 
     /**
      * DB2 TABLESPACE page size limits
@@ -83,9 +81,9 @@
      * DECIMAL type limits
      */
 
-	public static final int MAX_DECIMAL_PRECISION_SCALE = 31;
-	public static final int DEFAULT_DECIMAL_PRECISION   = 5;
-	public static final int DEFAULT_DECIMAL_SCALE       = 0;
+	public static final int DB2_MAX_DECIMAL_PRECISION_SCALE = 31;
+	public static final int DB2_DEFAULT_DECIMAL_PRECISION   = 5;
+	public static final int DB2_DEFAULT_DECIMAL_SCALE       = 0;
 
     /**
      * REAL/DOUBLE range limits

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java Fri May 13 11:35:33 2005
@@ -31,7 +31,7 @@
 
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 /**
  * This interface defines methods associated with a TypeId that are used
@@ -61,9 +61,9 @@
 	// Need to leave space for '-' and decimal point
 	public static final int REAL_MAXWIDTH_AS_CHAR	= 25;
 
-	public static final int DEFAULT_DECIMAL_PRECISION	= DB2Limit.DEFAULT_DECIMAL_PRECISION;
-	public static final int DEFAULT_DECIMAL_SCALE 		= DB2Limit.DEFAULT_DECIMAL_SCALE;
-	public static final int MAX_DECIMAL_PRECISION_SCALE = DB2Limit.MAX_DECIMAL_PRECISION_SCALE;
+	public static final int DEFAULT_DECIMAL_PRECISION	= Limits.DB2_DEFAULT_DECIMAL_PRECISION;
+	public static final int DEFAULT_DECIMAL_SCALE 		= Limits.DB2_DEFAULT_DECIMAL_SCALE;
+	public static final int MAX_DECIMAL_PRECISION_SCALE = Limits.DB2_MAX_DECIMAL_PRECISION_SCALE;
 
 	public static final int BOOLEAN_MAXWIDTH_AS_CHAR	= 5;
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java Fri May 13 11:35:33 2005
@@ -28,7 +28,7 @@
 import org.apache.derby.iapi.types.DataValueDescriptor;
 import org.apache.derby.iapi.types.TypeId;
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.types.*;
 
@@ -476,9 +476,9 @@
     public static float normalizeREAL(float v) throws StandardException
 	{
         if ( (Float.isNaN(v) || Float.isInfinite(v)) ||
-             ((v < DB2Limit.DB2_SMALLEST_REAL) || (v > DB2Limit.DB2_LARGEST_REAL)) ||
-             ((v > 0) && (v < DB2Limit.DB2_SMALLEST_POSITIVE_REAL)) ||
-             ((v < 0) && (v > DB2Limit.DB2_LARGEST_NEGATIVE_REAL)) )
+             ((v < Limits.DB2_SMALLEST_REAL) || (v > Limits.DB2_LARGEST_REAL)) ||
+             ((v > 0) && (v < Limits.DB2_SMALLEST_POSITIVE_REAL)) ||
+             ((v < 0) && (v > Limits.DB2_LARGEST_NEGATIVE_REAL)) )
         {
 			throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, TypeId.REAL_NAME);
         }
@@ -502,9 +502,9 @@
     {
         // can't just cast it to float and call normalizeFloat(float) since casting can round down to 0.0
         if ( (Double.isNaN(v) || Double.isInfinite(v)) ||
-             ((v < DB2Limit.DB2_SMALLEST_REAL) || (v > DB2Limit.DB2_LARGEST_REAL)) ||
-             ((v > 0) && (v < DB2Limit.DB2_SMALLEST_POSITIVE_REAL)) ||
-             ((v < 0) && (v > DB2Limit.DB2_LARGEST_NEGATIVE_REAL)) )
+             ((v < Limits.DB2_SMALLEST_REAL) || (v > Limits.DB2_LARGEST_REAL)) ||
+             ((v > 0) && (v < Limits.DB2_SMALLEST_POSITIVE_REAL)) ||
+             ((v < 0) && (v > Limits.DB2_LARGEST_NEGATIVE_REAL)) )
         {
 			throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, TypeId.REAL_NAME);
         }
@@ -522,9 +522,9 @@
     public static double normalizeDOUBLE(double v) throws StandardException
 	{
         if ( (Double.isNaN(v) || Double.isInfinite(v)) ||
-             ((v < DB2Limit.DB2_SMALLEST_DOUBLE) || (v > DB2Limit.DB2_LARGEST_DOUBLE)) ||
-             ((v > 0) && (v < DB2Limit.DB2_SMALLEST_POSITIVE_DOUBLE)) ||
-             ((v < 0) && (v > DB2Limit.DB2_LARGEST_NEGATIVE_DOUBLE)) )
+             ((v < Limits.DB2_SMALLEST_DOUBLE) || (v > Limits.DB2_LARGEST_DOUBLE)) ||
+             ((v > 0) && (v < Limits.DB2_SMALLEST_POSITIVE_DOUBLE)) ||
+             ((v < 0) && (v > Limits.DB2_LARGEST_NEGATIVE_DOUBLE)) )
         {
 			throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, TypeId.DOUBLE_NAME);
         }

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/TypeId.java Fri May 13 11:35:33 2005
@@ -31,7 +31,7 @@
 import org.apache.derby.catalog.types.DecimalTypeIdImpl;
 import org.apache.derby.catalog.types.UserDefinedTypeIdImpl;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
@@ -94,21 +94,21 @@
         public static final int REAL_SCALE                              = 0;
         public static final int REAL_MAXWIDTH                   = 4;
 
-        public static final int DECIMAL_PRECISION                       = DB2Limit.MAX_DECIMAL_PRECISION_SCALE;
-        public static final int DECIMAL_SCALE                           = DB2Limit.MAX_DECIMAL_PRECISION_SCALE;
-        public static final int DECIMAL_MAXWIDTH                        = DB2Limit.MAX_DECIMAL_PRECISION_SCALE;
+        public static final int DECIMAL_PRECISION                       = Limits.DB2_MAX_DECIMAL_PRECISION_SCALE;
+        public static final int DECIMAL_SCALE                           = Limits.DB2_MAX_DECIMAL_PRECISION_SCALE;
+        public static final int DECIMAL_MAXWIDTH                        = Limits.DB2_MAX_DECIMAL_PRECISION_SCALE;
 
         public static final int BOOLEAN_MAXWIDTH                        = 1;
 
-        public static final int CHAR_MAXWIDTH           = DB2Limit.DB2_CHAR_MAXWIDTH;
-        public static final int VARCHAR_MAXWIDTH        = DB2Limit.DB2_VARCHAR_MAXWIDTH;
-        public static final int LONGVARCHAR_MAXWIDTH = DB2Limit.DB2_LONGVARCHAR_MAXWIDTH;
+        public static final int CHAR_MAXWIDTH           = Limits.DB2_CHAR_MAXWIDTH;
+        public static final int VARCHAR_MAXWIDTH        = Limits.DB2_VARCHAR_MAXWIDTH;
+        public static final int LONGVARCHAR_MAXWIDTH = Limits.DB2_LONGVARCHAR_MAXWIDTH;
         public static final int NATIONAL_CHAR_MAXWIDTH  = Integer.MAX_VALUE;
         public static final int NATIONAL_VARCHAR_MAXWIDTH       = Integer.MAX_VALUE;
-        public static final int NATIONAL_LONGVARCHAR_MAXWIDTH = DB2Limit.DB2_LONGVARCHAR_MAXWIDTH;
-        public static final int BIT_MAXWIDTH            = DB2Limit.DB2_CHAR_MAXWIDTH;
-        public static final int VARBIT_MAXWIDTH         = DB2Limit.DB2_VARCHAR_MAXWIDTH;
-        public static final int LONGVARBIT_MAXWIDTH = DB2Limit.DB2_LONGVARCHAR_MAXWIDTH;
+        public static final int NATIONAL_LONGVARCHAR_MAXWIDTH = Limits.DB2_LONGVARCHAR_MAXWIDTH;
+        public static final int BIT_MAXWIDTH            = Limits.DB2_CHAR_MAXWIDTH;
+        public static final int VARBIT_MAXWIDTH         = Limits.DB2_VARCHAR_MAXWIDTH;
+        public static final int LONGVARBIT_MAXWIDTH = Limits.DB2_LONGVARCHAR_MAXWIDTH;
 
         // not supposed to be limited! 4096G should be ok(?), if Cloudscape can handle...
         public static final int BLOB_MAXWIDTH = Integer.MAX_VALUE; // to change long

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java Fri May 13 11:35:33 2005
@@ -28,7 +28,7 @@
 import org.apache.derby.jdbc.InternalDriver;
 
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.error.ExceptionSeverity;
 
@@ -138,8 +138,8 @@
 				if (userSuppliedSavepointName && (name == null))//make sure that if it is a named savepoint then supplied name is not null
 					throw newSQLException(SQLState.NULL_NAME_FOR_SAVEPOINT);
 				//make sure that if it is a named savepoint then supplied name length is not > 128
-				if (userSuppliedSavepointName && (name.length() > DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128))
-					throw newSQLException(SQLState.LANG_IDENTIFIER_TOO_LONG, name, String.valueOf(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128));
+				if (userSuppliedSavepointName && (name.length() > Limits.MAX_IDENTIFIER_LENGTH))
+					throw newSQLException(SQLState.LANG_IDENTIFIER_TOO_LONG, name, String.valueOf(Limits.MAX_IDENTIFIER_LENGTH));
 				if (userSuppliedSavepointName && name.startsWith("SYS")) //to enforce DB2 restriction which is savepoint name can't start with SYS
 					throw newSQLException(SQLState.INVALID_SCHEMA_SYS, "SYS");
 				Savepoint savePt = new EmbedSavepoint30(this, name);

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java Fri May 13 11:35:33 2005
@@ -34,7 +34,7 @@
 import org.apache.derby.impl.sql.execute.GenericConstantActionFactory;
 import org.apache.derby.impl.sql.execute.GenericExecutionFactory;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.reference.JDBC20Translation;
 import org.apache.derby.iapi.reference.JDBC30Translation;
 
@@ -1095,7 +1095,7 @@
      * @return max literal length
      */
 	public int getMaxColumnNameLength() {
-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
+		return Limits.MAX_IDENTIFIER_LENGTH;
 	}
 
     /**
@@ -1160,7 +1160,7 @@
      * @return max cursor name length in bytes
      */
 	public int getMaxCursorNameLength() {
-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18;
+		return Limits.MAX_IDENTIFIER_LENGTH;
 	}
 
     /**
@@ -1178,7 +1178,7 @@
      * @return max name length in bytes
      */
 	public int getMaxSchemaNameLength()  {
-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
+		return Limits.MAX_IDENTIFIER_LENGTH;
 	}
 
     /**
@@ -1187,7 +1187,7 @@
      * @return max name length in bytes
      */
 	public int getMaxProcedureNameLength() {
-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
+		return Limits.MAX_IDENTIFIER_LENGTH;
 	}
 
     /**
@@ -1243,7 +1243,7 @@
      * @return max name length in bytes
      */
 	public int getMaxTableNameLength() {
-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
+		return Limits.MAX_IDENTIFIER_LENGTH;
 	}
 
     /**
@@ -1261,7 +1261,7 @@
      * @return max name length  in bytes
      */
 	public int getMaxUserNameLength() {
-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
+		return Limits.DB2_MAX_USERID_LENGTH;
 	}
 
     //----------------------------------------------------------------------

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java Fri May 13 11:35:33 2005
@@ -24,7 +24,7 @@
 import org.apache.derby.iapi.reference.Property;
 import org.apache.derby.iapi.jdbc.AuthenticationService;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.i18n.MessageService;
@@ -188,7 +188,7 @@
 			return false;
 
 		String userName = userInfo.getProperty(Attribute.USERNAME_ATTR);
-		if ((userName != null) && userName.length() > DB2Limit.MAX_USERID_LENGTH) {
+		if ((userName != null) && userName.length() > Limits.DB2_MAX_USERID_LENGTH) {
 		// DB2 has limits on length of the user id, so we enforce the same.
 		// This used to be error 28000 "Invalid authorization ID", but with v82,
 		// DB2 changed the behavior to return a normal "authorization failure

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java Fri May 13 11:35:33 2005
@@ -23,7 +23,7 @@
 import java.sql.SQLException;
 import org.apache.derby.vti.VTIMetaDataTemplate;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 class ImportResultSetMetaData extends VTIMetaDataTemplate {
 
@@ -55,7 +55,7 @@
   }
 	public int getColumnDisplaySize(int column) {
     if (columnWidths == null)
-       return DB2Limit.DB2_VARCHAR_MAXWIDTH;
+       return Limits.DB2_VARCHAR_MAXWIDTH;
     else
        return columnWidths[column-1];
   }

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java Fri May 13 11:35:33 2005
@@ -47,7 +47,7 @@
 import org.apache.derby.iapi.services.info.ProductGenusNames;
 import org.apache.derby.iapi.services.info.ProductVersionHolder;
 import org.apache.derby.iapi.reference.JDBC30Translation;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.services.uuid.UUIDFactory;
 import org.apache.derby.catalog.UUID;

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java Fri May 13 11:35:33 2005
@@ -23,7 +23,7 @@
 import org.apache.derby.iapi.reference.JDBC30Translation;
 import org.apache.derby.iapi.reference.Property;
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 
@@ -8180,7 +8180,7 @@
 
 
         // void SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(
-        //     varchar(128), varchar(DB2Limit.DB2_VARCHAR_MAXWIDTH))
+        //     varchar(128), varchar(Limits.DB2_VARCHAR_MAXWIDTH))
         {
 
             // procedure argument names
@@ -8193,7 +8193,7 @@
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
                     Types.VARCHAR, 128),
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
-                    Types.VARCHAR, DB2Limit.DB2_VARCHAR_MAXWIDTH)
+                    Types.VARCHAR, Limits.DB2_VARCHAR_MAXWIDTH)
             };
 
             createSystemProcedureOrFunction(
@@ -8279,7 +8279,7 @@
                 tc);
         }
 
-        // void SYSCS_UTIL.SYSCS_BACKUP_DATABASE(varchar DB2Limit.DB2_VARCHAR_MAXWIDTH)
+        // void SYSCS_UTIL.SYSCS_BACKUP_DATABASE(varchar Limits.DB2_VARCHAR_MAXWIDTH)
         {
             // procedure argument names
             String[] arg_names = {"BACKUPDIR"};
@@ -8287,7 +8287,7 @@
             // procedure argument types
             TypeDescriptor[] arg_types = {
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
-                    Types.VARCHAR, DB2Limit.DB2_VARCHAR_MAXWIDTH)
+                    Types.VARCHAR, Limits.DB2_VARCHAR_MAXWIDTH)
             };
 
             createSystemProcedureOrFunction(
@@ -8303,7 +8303,7 @@
         }
 
         // void SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
-        //     varchar DB2Limit.DB2_VARCHAR_MAXWIDTH, smallint)
+        //     varchar Limits.DB2_VARCHAR_MAXWIDTH, smallint)
         {
             // procedure argument names
             String[] arg_names = {"BACKUPDIR", "DELETE_ARCHIVED_LOG_FILES"};
@@ -8311,7 +8311,7 @@
             // procedure argument types
             TypeDescriptor[] arg_types = {
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
-                    Types.VARCHAR, DB2Limit.DB2_VARCHAR_MAXWIDTH),
+                    Types.VARCHAR, Limits.DB2_VARCHAR_MAXWIDTH),
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
                     Types.SMALLINT)
             };
@@ -8404,7 +8404,7 @@
         // the following need to be functions when that is supported.
         // until then calling them will not work.
 
-        // VARCHAR(DB2Limit.DB2_VARCHAR_MAXWIDTH) 
+        // VARCHAR(Limits.DB2_VARCHAR_MAXWIDTH) 
         // SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY(varchar(128))
 
         {
@@ -8426,7 +8426,7 @@
 				0,
                 RoutineAliasInfo.READS_SQL_DATA,
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
-                    Types.VARCHAR, DB2Limit.DB2_VARCHAR_MAXWIDTH),
+                    Types.VARCHAR, Limits.DB2_VARCHAR_MAXWIDTH),
                 tc);
         }
 
@@ -8468,13 +8468,13 @@
 				0,
                 RoutineAliasInfo.CONTAINS_SQL,
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
-                    Types.VARCHAR, DB2Limit.DB2_VARCHAR_MAXWIDTH),
+                    Types.VARCHAR, Limits.DB2_VARCHAR_MAXWIDTH),
 
                 /*
                 TODO - mikem, wants to be a CLOB, but don't know how to do 
                 that yet.  Testing it with varchar for now.
                 DataTypeDescriptor.getBuiltInDataTypeDescriptor(
-                    Types.CLOB, DB2Limit.DB2_LOB_MAXWIDTH),
+                    Types.CLOB, Limits.DB2_LOB_MAXWIDTH),
                 */
                 tc);
         }
@@ -8867,7 +8867,7 @@
 				DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.INTEGER),
 				DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.SMALLINT),
 				DataTypeDescriptor.getBuiltInDataTypeDescriptor(
-						Types.VARCHAR, DB2Limit.DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH),
+						Types.VARCHAR, Limits.DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH),
 				DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.CHAR, 8),
 				DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.INTEGER),
 				DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.INTEGER),

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java Fri May 13 11:35:33 2005
@@ -21,7 +21,7 @@
 package	org.apache.derby.impl.sql.compile;
 
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -236,12 +236,12 @@
 			tableElementList.validate(this, dd, baseTable);
 
 			/* Only 1012 columns allowed per table */
-			if ((tableElementList.countNumberOfColumns() + baseTable.getNumberOfColumns()) > DB2Limit.DB2_MAX_COLUMNS_IN_TABLE)
+			if ((tableElementList.countNumberOfColumns() + baseTable.getNumberOfColumns()) > Limits.DB2_MAX_COLUMNS_IN_TABLE)
 			{
 				throw StandardException.newException(SQLState.LANG_TOO_MANY_COLUMNS_IN_TABLE_OR_VIEW,
 					String.valueOf(tableElementList.countNumberOfColumns() + baseTable.getNumberOfColumns()),
 					getRelativeName(),
-					String.valueOf(DB2Limit.DB2_MAX_COLUMNS_IN_TABLE));
+					String.valueOf(Limits.DB2_MAX_COLUMNS_IN_TABLE));
 			}
 			/* Number of backing indexes in the alter table statment */
 			numBackingIndexes = tableElementList.countConstraints(DataDictionary.PRIMARYKEY_CONSTRAINT) +
@@ -254,12 +254,12 @@
 
 		//If the sum of backing indexes for constraints in alter table statement and total number of indexes on the table
 		//so far is more than 32767, then we need to throw an exception 
-		if ((numBackingIndexes + baseTable.getTotalNumberOfIndexes()) > DB2Limit.DB2_MAX_INDEXES_ON_TABLE)
+		if ((numBackingIndexes + baseTable.getTotalNumberOfIndexes()) > Limits.DB2_MAX_INDEXES_ON_TABLE)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_INDEXES_ON_TABLE, 
 				String.valueOf(numBackingIndexes + baseTable.getTotalNumberOfIndexes()),
 				getRelativeName(),
-				String.valueOf(DB2Limit.DB2_MAX_INDEXES_ON_TABLE));
+				String.valueOf(Limits.DB2_MAX_INDEXES_ON_TABLE));
 		}
 
 		if (numCheckConstraints > 0)

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java Fri May 13 11:35:33 2005
@@ -24,7 +24,7 @@
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.sql.compile.CompilerContext;
@@ -576,7 +576,7 @@
 		ValueNode defaultNode, String defaultText)
 	{
 
-		if (defaultText.length() > DB2Limit.DB2_CHAR_MAXWIDTH)
+		if (defaultText.length() > Limits.DB2_CHAR_MAXWIDTH)
 		// DB2 spec says this isn't allowed.
 			return false;
 
@@ -622,12 +622,12 @@
 				// DB2 enforces min length of 8.
 				// Note also: any size under 30 gives a warning in DB2.
 					return (charCol && (columnDesc.getMaximumWidth() >=
-						DB2Limit.MIN_COL_LENGTH_FOR_CURRENT_USER));
+						Limits.DB2_MIN_COL_LENGTH_FOR_CURRENT_USER));
 
 				case C_NodeTypes.CURRENT_SCHEMA_NODE:
 				// DB2 enforces min length of 128.
 					return (charCol && (columnDesc.getMaximumWidth() >=
-						DB2Limit.MIN_COL_LENGTH_FOR_CURRENT_SCHEMA));
+						Limits.DB2_MIN_COL_LENGTH_FOR_CURRENT_SCHEMA));
 				default:
 					// else, function not allowed.
 					return false;

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java Fri May 13 11:35:33 2005
@@ -40,7 +40,7 @@
 import org.apache.derby.iapi.services.compiler.LocalField;
 import org.apache.derby.impl.sql.compile.ExpressionClassBuilder;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.reference.ClassName;
 
@@ -374,7 +374,7 @@
 			{
 				case Types.CHAR:
 				case Types.BINARY:
-					if (resultLength > DB2Limit.DB2_CHAR_MAXWIDTH) {
+					if (resultLength > Limits.DB2_CHAR_MAXWIDTH) {
 						if (rightTypeId.getJDBCTypeId() == Types.CHAR)
 								//operands CHAR(A) CHAR(B) and A+B>254 then result is VARCHAR(A+B)
 								higherType = TypeId.VARCHAR_NAME;
@@ -386,7 +386,7 @@
 
 				case Types.VARCHAR:
 				case Types.VARBINARY:
-					if (resultLength > DB2Limit.DB2_CONCAT_VARCHAR_LENGTH) {
+					if (resultLength > Limits.DB2_CONCAT_VARCHAR_LENGTH) {
 						if (rightTypeId.getJDBCTypeId() == Types.VARCHAR)
 								//operands CHAR(A) VARCHAR(B) and A+B>4000 then result is LONG VARCHAR
 								higherType = TypeId.LONGVARCHAR_NAME;
@@ -408,7 +408,7 @@
 			{
 				case Types.CHAR: //operands CHAR(A) VARCHAR(B) and A+B>4000 then result is LONG VARCHAR
 				case Types.VARCHAR: //operands VARCHAR(A) VARCHAR(B) and A+B>4000 then result is LONG VARCHAR
-					if (resultLength > DB2Limit.DB2_CONCAT_VARCHAR_LENGTH)
+					if (resultLength > Limits.DB2_CONCAT_VARCHAR_LENGTH)
 						higherType = TypeId.LONGVARCHAR_NAME;
 					break;
 
@@ -422,7 +422,7 @@
 			{
 				case Types.BINARY: //operands CHAR FOR BIT DATA(A) VARCHAR FOR BIT DATA(B) and A+B>4000 then result is LONG VARCHAR FOR BIT DATA
 				case Types.VARBINARY://operands VARCHAR FOR BIT DATA(A) VARCHAR FOR BIT DATA(B) and A+B>4000 then result is LONG VARCHAR FOR BIT DATA
-					if (resultLength > DB2Limit.DB2_CONCAT_VARCHAR_LENGTH)
+					if (resultLength > Limits.DB2_CONCAT_VARCHAR_LENGTH)
 						higherType = TypeId.LONGVARBIT_NAME;
 					break;
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java Fri May 13 11:35:33 2005
@@ -28,7 +28,7 @@
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.sql.ResultSet;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
@@ -139,9 +139,9 @@
 				TypeDescriptor[] types = null;
 				int[] modes = null;
 				
-				if (paramCount > DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE)
+				if (paramCount > Limits.DB2_MAX_PARAMS_IN_STORED_PROCEDURE)
 					throw StandardException.newException(SQLState.LANG_TOO_MANY_PARAMETERS_FOR_STORED_PROC,
-							String.valueOf(DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE), aliasName, String.valueOf(paramCount));
+							String.valueOf(Limits.DB2_MAX_PARAMS_IN_STORED_PROCEDURE), aliasName, String.valueOf(paramCount));
 
 				if (paramCount != 0) {
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java Fri May 13 11:35:33 2005
@@ -35,7 +35,7 @@
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.reference.Property;
 
 import org.apache.derby.iapi.sql.execute.ConstantAction;
@@ -182,12 +182,12 @@
 		}
 
 		//If total number of indexes on the table so far is more than 32767, then we need to throw an exception
-		if (td.getTotalNumberOfIndexes() > DB2Limit.DB2_MAX_INDEXES_ON_TABLE)
+		if (td.getTotalNumberOfIndexes() > Limits.DB2_MAX_INDEXES_ON_TABLE)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_INDEXES_ON_TABLE,
 				String.valueOf(td.getTotalNumberOfIndexes()),
 				tableName,
-				String.valueOf(DB2Limit.DB2_MAX_INDEXES_ON_TABLE));
+				String.valueOf(Limits.DB2_MAX_INDEXES_ON_TABLE));
 		}
 
 		/* Validate the column name list */

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java Fri May 13 11:35:33 2005
@@ -22,7 +22,7 @@
 
 import org.apache.derby.iapi.reference.Property;
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.services.property.PropertyUtil;
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -212,12 +212,12 @@
 		tableElementList.validate(this, dataDictionary, (TableDescriptor) null);
 
 		/* Only 1012 columns allowed per table */
-		if (tableElementList.countNumberOfColumns() > DB2Limit.DB2_MAX_COLUMNS_IN_TABLE)
+		if (tableElementList.countNumberOfColumns() > Limits.DB2_MAX_COLUMNS_IN_TABLE)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_COLUMNS_IN_TABLE_OR_VIEW,
 				String.valueOf(tableElementList.countNumberOfColumns()),
 				getRelativeName(),
-				String.valueOf(DB2Limit.DB2_MAX_COLUMNS_IN_TABLE));
+				String.valueOf(Limits.DB2_MAX_COLUMNS_IN_TABLE));
 		}
 
 		numPrimaryKeys = tableElementList.countConstraints(
@@ -246,12 +246,12 @@
 
 		//each of these constraints have a backing index in the back. We need to make sure that a table never has more
 		//more than 32767 indexes on it and that is why this check.
-		if ((numPrimaryKeys + numReferenceConstraints + numUniqueConstraints) > DB2Limit.DB2_MAX_INDEXES_ON_TABLE)
+		if ((numPrimaryKeys + numReferenceConstraints + numUniqueConstraints) > Limits.DB2_MAX_INDEXES_ON_TABLE)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_INDEXES_ON_TABLE, 
 				String.valueOf(numPrimaryKeys + numReferenceConstraints + numUniqueConstraints),
 				getRelativeName(),
-				String.valueOf(DB2Limit.DB2_MAX_INDEXES_ON_TABLE));
+				String.valueOf(Limits.DB2_MAX_INDEXES_ON_TABLE));
 		}
 
 		if (numCheckConstraints > 0)

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java Fri May 13 11:35:33 2005
@@ -45,7 +45,7 @@
 import org.apache.derby.iapi.sql.depend.ProviderList;
 
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 
@@ -221,12 +221,12 @@
 
 
 		/* Only 5000 columns allowed per view */
-		if (queryExpression.getResultColumns().size() > DB2Limit.DB2_MAX_COLUMNS_IN_VIEW)
+		if (queryExpression.getResultColumns().size() > Limits.DB2_MAX_COLUMNS_IN_VIEW)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_COLUMNS_IN_TABLE_OR_VIEW,
 				String.valueOf(queryExpression.getResultColumns().size()),
 				getRelativeName(),
-				String.valueOf(DB2Limit.DB2_MAX_COLUMNS_IN_VIEW));
+				String.valueOf(Limits.DB2_MAX_COLUMNS_IN_VIEW));
 		}
 
 		// for each column, stuff system.column

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByList.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByList.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByList.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByList.java Fri May 13 11:35:33 2005
@@ -29,7 +29,7 @@
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.impl.sql.compile.ActivationClassBuilder;
 
@@ -130,7 +130,7 @@
 		int				 size = size();
 
 		/* Only 32677 columns allowed in GROUP BY clause */
-		if (size > DB2Limit.DB2_MAX_ELEMENTS_IN_GROUP_BY)
+		if (size > Limits.DB2_MAX_ELEMENTS_IN_GROUP_BY)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_ELEMENTS);
 		}

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java Fri May 13 11:35:33 2005
@@ -41,7 +41,7 @@
 import org.apache.derby.iapi.sql.compile.TypeCompiler;
 
 import org.apache.derby.iapi.reference.ClassName;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.compiler.LocalField;
 import org.apache.derby.iapi.services.compiler.MethodBuilder;
@@ -447,9 +447,9 @@
 			val = this.getScale(operator, leftType, rightType) +
 					Math.max(lprec - lscale, rprec - rscale) + 1;
 
-			if (val > DB2Limit.MAX_DECIMAL_PRECISION_SCALE)
+			if (val > Limits.DB2_MAX_DECIMAL_PRECISION_SCALE)
 			// then, like DB2, just set it to the max possible.
-				val = DB2Limit.MAX_DECIMAL_PRECISION_SCALE;
+				val = Limits.DB2_MAX_DECIMAL_PRECISION_SCALE;
 		}
 
 		if (val > Integer.MAX_VALUE)

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java Fri May 13 11:35:33 2005
@@ -47,7 +47,7 @@
 import org.apache.derby.iapi.types.DataValueDescriptor;
 
 import org.apache.derby.iapi.reference.ClassName;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.reference.SQLState;
 
 import org.apache.derby.iapi.util.JBitSet;
@@ -142,7 +142,7 @@
 		int size = size();
 
 		/* Only 1012 columns allowed in ORDER BY clause */
-		if (size > DB2Limit.DB2_MAX_ELEMENTS_IN_ORDER_BY)
+		if (size > Limits.DB2_MAX_ELEMENTS_IN_ORDER_BY)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_ELEMENTS);
 		}

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java Fri May 13 11:35:33 2005
@@ -32,7 +32,7 @@
 import org.apache.derby.iapi.types.TypeId;
 import org.apache.derby.iapi.types.DataTypeDescriptor;
 
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.error.StandardException;
 
@@ -661,7 +661,7 @@
 		super.bindResultColumns(fromListParam);
 
 		/* Only 1012 elements allowed in select list */
-		if (resultColumns.size() > DB2Limit.DB2_MAX_ELEMENTS_IN_SELECT_LIST)
+		if (resultColumns.size() > Limits.DB2_MAX_ELEMENTS_IN_SELECT_LIST)
 		{
 			throw StandardException.newException(SQLState.LANG_TOO_MANY_ELEMENTS);
 		}

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Fri May 13 11:35:33 2005
@@ -125,7 +125,7 @@
 
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.reference.JDBC30Translation;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
@@ -326,13 +326,13 @@
 	switch (type) {
 		case Types.BINARY:
 		case Types.CHAR:
-			if (length  > DB2Limit.DB2_CHAR_MAXWIDTH)
+			if (length  > Limits.DB2_CHAR_MAXWIDTH)
 				valid = false;
 			break;
 			
 		case Types.VARBINARY:
 		case Types.VARCHAR:
-			if (length  > DB2Limit.DB2_VARCHAR_MAXWIDTH)
+			if (length  > Limits.DB2_VARCHAR_MAXWIDTH)
 				valid = false;
 
 			break;
@@ -2582,7 +2582,7 @@
 		return getDeleteNode(fromTable, tableName, whereClause);
 	}
 |
-	<FROM> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	<FROM> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	    [targetProperties = propertyList() ] 
 		[ 
 			whereToken = <WHERE>
@@ -2648,7 +2648,7 @@
 }
 {
 	//cursor names are limited to 18 characters
-	<CURRENT> <OF> cursorName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
+	<CURRENT> <OF> cursorName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{ 
 		return (FromTable) nodeFactory.getNode(
 								C_NodeTypes.CURRENT_OF_NODE,
@@ -2759,7 +2759,7 @@
 								getContextManager()); 
 	}
 |
-	tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		return (QueryTreeNode) tableName;
 	}
@@ -2830,7 +2830,7 @@
 		return getUpdateNode(fromTable, tableName, columnList, whereClause);
 	}
 |
-		tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+		tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 		[targetProperties = propertyList() ] 
 		<SET> columnList = setClauseList()
 		[ 
@@ -3019,18 +3019,18 @@
 }
 {
 	(
-	<SAVEPOINT> savepointName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) (savepointStatementClause(savepointStatementClauses))+
+	<SAVEPOINT> savepointName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) (savepointStatementClause(savepointStatementClauses))+
 	{
 		//ON ROLLBACK RETAIN CURSORS is mandatory
 		if (savepointStatementClauses[2] == null)
 				throw StandardException.newException(SQLState.LANG_SYNTAX_ERROR, "MISSING ON ROLLBACK RETAIN CURSORS");
 		savepointStatementType = 1;
 	}
-|	<ROLLBACK> [ <WORK> ] <TO> <SAVEPOINT> [ savepointName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) ]
+|	<ROLLBACK> [ <WORK> ] <TO> <SAVEPOINT> [ savepointName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) ]
 	{
 		savepointStatementType = 2;
 	}
-|	<RELEASE> [ <TO> ] <SAVEPOINT> savepointName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+|	<RELEASE> [ <TO> ] <SAVEPOINT> savepointName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		savepointStatementType = 3;
 	}
@@ -3104,7 +3104,7 @@
 	Object[] declareTableClauses = new Object[3];
 }
 { 
-	<DECLARE> <GLOBAL> <TEMPORARY> <TABLE> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+	<DECLARE> <GLOBAL> <TEMPORARY> <TABLE> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 		tableElementList = tableElementList()
 		( declareTableClause(declareTableClauses) ) +
 	{
@@ -3240,7 +3240,7 @@
 
 	/* identifier() used to be columnName() */
 	//unqualified column names are limited to 30 characters
-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) 
+	columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) 
 		( typeDescriptor = dataTypeDDL() 
 		)
 	[ defaultNode = defaultAndConstraints(typeDescriptor, tableElementList, columnName, autoIncrementInfo) ]
@@ -3880,7 +3880,7 @@
 			
 			// match DB2 limits of 1 to 2147483647
 			if ((specifiedLength > 0L) && 
-                (specifiedLength <= DB2Limit.DB2_LOB_MAXWIDTH))
+                (specifiedLength <= Limits.DB2_LOB_MAXWIDTH))
             {
 				return (int)specifiedLength;
             }
@@ -3888,7 +3888,7 @@
 			// DB2 allows 2G or 2048M or 2097152k that calculate out to 
             // 2147483648, but sets the length to be one less.
 			if (mul != 1 && specifiedLength == 2147483648L)
-				return DB2Limit.DB2_LOB_MAXWIDTH;
+				return Limits.DB2_LOB_MAXWIDTH;
 				
 		}
 		catch (NumberFormatException nfe)
@@ -4090,7 +4090,7 @@
 	String	secondName = null;
 }
 {
-	firstName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false)
+	firstName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false)
 				[
 					// This LOOKAHEAD is necessary because a selectSublist()
 					// can be a qualifiedName.*. Make sure that the token after
@@ -4098,7 +4098,7 @@
 					// optional element.
 					LOOKAHEAD( {getToken(1).kind == PERIOD &&
 								getToken(2).kind != ASTERISK} )
-					<PERIOD> secondName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false)
+					<PERIOD> secondName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false)
 				]
 	{
 		if (secondName == null)
@@ -4114,7 +4114,7 @@
 		//limit the qualifiedId to the id length limit passed to this method
 		checkIdentifierLengthLimit(qualifiedId, id_length_limit);
 		if (schemaName != null)
-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
+			checkIdentifierLengthLimit(schemaName, Limits.MAX_IDENTIFIER_LENGTH);
 
 		return (TableName) nodeFactory.getNode(
 								nodeType,
@@ -4457,7 +4457,7 @@
 			)
 		}
 	)
-	tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) <PERIOD> <ASTERISK>
+	tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) <PERIOD> <ASTERISK>
 	{
 		allResultColumn = (ResultColumn) nodeFactory.getNode(
 										C_NodeTypes.ALL_RESULT_COLUMN,
@@ -4518,7 +4518,7 @@
 {
 	/* identifier() used to be columnName() */
 	//unqualified column names are limited to 30 characters
-	[ <AS> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
+	[ <AS> ] columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		return columnName;
 	}
@@ -6287,7 +6287,7 @@
 	MethodCallNode	methodNode;
 }
 {
-	routineName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+	routineName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 		methodCallParameterList(parameterList)
 	{
 
@@ -6360,7 +6360,7 @@
 	ValueNode	retval;
 }
 {
-	firstName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	firstName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	[
 		// This LOOKAHEAD is required because we have the following cases:
 		// schema.table.column.method()
@@ -6374,7 +6374,7 @@
 					getToken(1).kind == PERIOD &&
 					getToken(3).kind == PERIOD
 				} )
-		<PERIOD> secondName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+		<PERIOD> secondName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 		[
 			// See above: we don't want to mistake the method name for a
 			// column name.
@@ -6382,7 +6382,7 @@
 						getToken(1).kind == PERIOD &&
 						getToken(3).kind == PERIOD
 					} )
-			<PERIOD> thirdName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+			<PERIOD> thirdName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 		]
 	]
 	{
@@ -6451,7 +6451,7 @@
 	TableName	tabName = null;
 }
 {
-	firstName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false)
+	firstName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false)
 	[
 		// This LOOKAHEAD is needed to ensure that, if the identifier
 		// after the PERIOD is a method name , we
@@ -6460,7 +6460,7 @@
 					getToken(1).kind == PERIOD &&
 					getToken(3).kind != LEFT_PAREN
 				} )
-		<PERIOD> secondName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false)
+		<PERIOD> secondName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false)
 		[
 			// This LOOKAHEAD is needed to ensure that, if the identifier
 			// after the PERIOD is a method name , we
@@ -6469,7 +6469,7 @@
 						getToken(1).kind == PERIOD &&
 						getToken(3).kind != LEFT_PAREN
 					} )
-			<PERIOD> thirdName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false)
+			<PERIOD> thirdName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false)
 		]
 	]
 	{
@@ -6497,11 +6497,11 @@
 		}
 
 		//column name and schema name can not be longer than 30 characters and table name can not be longer than 128 characters
-		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
+		checkIdentifierLengthLimit(columnName, Limits.MAX_IDENTIFIER_LENGTH);
 		if (schemaName != null)
-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
+			checkIdentifierLengthLimit(schemaName, Limits.MAX_IDENTIFIER_LENGTH);
 		if (tableName != null)
-			checkIdentifierLengthLimit(tableName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
+			checkIdentifierLengthLimit(tableName, Limits.MAX_IDENTIFIER_LENGTH);
 
 		if (tableName != null)
 		{
@@ -6676,7 +6676,7 @@
 {
 	/* identifier() used to be columnName() */
 	//unqualified column names are limited to 30 characters
-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
+	columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		columnList.addElement(columnName);
 	}
@@ -7485,7 +7485,7 @@
 	}
 |
 	[ [ <AS> ] 
-		correlationName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+		correlationName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 		[ <LEFT_PAREN> derivedRCL = derivedColumnList() <RIGHT_PAREN> ] 
 	    [tableProperties = propertyList() ] ]
 	{
@@ -7535,7 +7535,7 @@
 	 */
 	/* identifier() used to be correlationName() */
 	LOOKAHEAD( { newInvocationFollows(1) } )
-	javaToSQLNode = newInvocation() [ <AS> ] correlationName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	javaToSQLNode = newInvocation() [ <AS> ] correlationName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 		[ <LEFT_PAREN> derivedRCL = derivedColumnList() <RIGHT_PAREN> ]
 		[ optionalTableClauses = optionalTableProperties() ]
 		(LOOKAHEAD( { joinedTableExpressionFollows() } )
@@ -7575,7 +7575,7 @@
 	}
 |
 	/* identifier() used to be correlationName() */
-	tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 		optionalTableClauses = optionalTableClauses()
 		(LOOKAHEAD( { joinedTableExpressionFollows() } )
 		 joinTable = joinedTableExpression(
@@ -7631,7 +7631,7 @@
 					getToken(2).kind == VALUES
 				)
 			} )
-	derivedTable = derivedTable() [ <AS> ] correlationName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	derivedTable = derivedTable() [ <AS> ] correlationName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 		[ <LEFT_PAREN> derivedRCL = derivedColumnList() <RIGHT_PAREN> ]
 		[ optionalTableClauses = optionalTableProperties() ]
 		( LOOKAHEAD( { joinedTableExpressionFollows() } )
@@ -7731,7 +7731,7 @@
 {
 	/* identifier() used to be columnName() */
 	//unqualified column names are limited to 30 characters
-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
+	columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		/*
 		** Store the column names for the result columns in the
@@ -7768,7 +7768,7 @@
 }
 {
 	/* identifier never ends with a space; appending a space meaning desc */
-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
+	columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
 	{
 		/*
 		** Store the column names for the index columns in the
@@ -8143,7 +8143,7 @@
 	** a user aggregate here; otherwise, we have to generate
 	** a staticMethodNode and fix it up later.
 	*/
-	methodAliasString = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	methodAliasString = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	<LEFT_PAREN> setQuantifier() value = additiveExpression(null, 0, false) <RIGHT_PAREN>
 	{
 		return (ValueNode) nodeFactory.getNode(
@@ -8359,7 +8359,7 @@
 	** We are not currently handling character set
 	** specifications for schema, or schema bodies.
 	*/
-	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
+	<SCHEMA> schemaName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 
 		if (schemaName.startsWith("SYS"))
@@ -8386,7 +8386,7 @@
 	TableElementList	tableElementList;
 }
 {
-	<TABLE> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+	<TABLE> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	tableElementList = tableElementList()
 	[ properties = propertyList()]
 	{
@@ -8510,7 +8510,7 @@
 	** production to get the grammar to work...
 	*/
 	[ unique = unique() ] <INDEX>
-		indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) <ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+		indexName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) <ON> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 				<LEFT_PAREN> indexColumnList(indexColumnList) <RIGHT_PAREN>
 		[ properties = propertyList()]
 	{
@@ -8591,7 +8591,7 @@
 	Object[] procedureElements = new Object[9];
 }
 {
-		<PROCEDURE> procedureName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+		<PROCEDURE> procedureName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 		procedureElements[0] = procedureParameterList()
 		( routineElement(true, procedureElements) ) +
 		{
@@ -8616,7 +8616,7 @@
 }
 {
 	(
-		<SPECIFIC> clauseValue = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+		<SPECIFIC> clauseValue = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 			{ clausePosition = 1; throw StandardException.newException(SQLState.NOT_IMPLEMENTED, "SPECIFIC identifier");}
 	|
 		[ <DYNAMIC> ] <RESULT> <SETS> drs = uint_value()
@@ -8712,7 +8712,7 @@
 }
 {
 	inout = inoutParameter()
-	parameterName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) 
+	parameterName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) 
 	typeDescriptor = dataTypeDDL() 
 	{
 		list[0].addElement(parameterName);
@@ -8758,7 +8758,7 @@
 	Object[] functionElements = new Object[9];
 }
 {
-		<FUNCTION> functionName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+		<FUNCTION> functionName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 		functionElements[0] = functionParameterList()
 		<RETURNS> functionElements[8] = dataTypeCommon() 
 		( routineElement(false, functionElements) ) +
@@ -8805,7 +8805,7 @@
 	Integer				inout;
 }
 {
-	parameterName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) 
+	parameterName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) 
 	typeDescriptor = dataTypeDDL() 
 	{
 		list[0].addElement(parameterName);
@@ -8825,7 +8825,7 @@
 	Token				endToken;
 }
 {
-	<VIEW> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	<VIEW> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 		[ <LEFT_PAREN> resultColumns = viewColumnList() <RIGHT_PAREN> ]
 		<AS> queryExpression = queryExpression(null, NO_SET_OP)
 	{
@@ -8888,10 +8888,10 @@
 	Vector				refClause = null;
 }
 {
-	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+	<TRIGGER> triggerName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	isBefore = beforeOrAfter()
 		triggerEvent = triggerEvent(triggerColumns)		// { INSERT | DELETE | UPDATE [ colList	] }
-		<ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
+		<ON> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 		[ refClause = triggerReferencingClause() ]		// REFERENCING OLD/NEW AS 	
 		<FOR> <EACH> isRow = rowOrStatement()
 		<MODE> <DB2SQL>
@@ -9018,7 +9018,7 @@
 	  <OLD_TABLE> { isNew = false; isRow = false;}
 	)
 
-	<AS> identifier = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	<AS> identifier = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		vector.addElement(new TriggerReferencingStruct(isRow, isNew, identifier));
 	}
@@ -9319,7 +9319,7 @@
 			SanityManager.ASSERT(ePosn != -1, "no E or e in approximate numeric");
 
 		// there is a limit on the length of a floatingpoint literal in DB2
-		if (doubleString.length() > DB2Limit.DB2_MAX_FLOATINGPOINT_LITERAL_LENGTH)
+		if (doubleString.length() > Limits.DB2_MAX_FLOATINGPOINT_LITERAL_LENGTH)
 			throw StandardException.newException(SQLState.LANG_DB2_TOO_LONG_FLOATING_POINT_LITERAL, doubleString, TypeId.DOUBLE_NAME);
 		// if there is no '.' before the e, put one in
 		dotPosn = doubleString.substring(0,ePosn).indexOf('.');
@@ -9492,7 +9492,7 @@
 	tok = <STRING>
 	{
 		//there is a maximum limit on the length of the string
-		if (tok.image.length()-2 > DB2Limit.DB2_MAX_CHARACTER_LITERAL_LENGTH)//-2 is for the beginning and ending quote
+		if (tok.image.length()-2 > Limits.DB2_MAX_CHARACTER_LITERAL_LENGTH)//-2 is for the beginning and ending quote
 			throw StandardException.newException(SQLState.LANG_DB2_STRING_CONSTANT_TOO_LONG, StringUtil.formatForPrint(tok.image));
 		string = compressQuotes(tok.image.substring(1, tok.image.length() - 1), SINGLEQUOTES);
 		/* Trim quotes from string. */
@@ -9517,7 +9517,7 @@
 		String hexLiteral = tok.image;
 
 		//there is a maximum limit on the length of the hex constant
-		if (hexLiteral.length()-3 > DB2Limit.DB2_MAX_HEX_LITERAL_LENGTH)//-3 is for X' at the beginning and ' at the end
+		if (hexLiteral.length()-3 > Limits.DB2_MAX_HEX_LITERAL_LENGTH)//-3 is for X' at the beginning and ' at the end
 			throw StandardException.newException(SQLState.LANG_DB2_STRING_CONSTANT_TOO_LONG, StringUtil.formatForPrint(hexLiteral));
 		if ((hexLiteral.length()-3)%2 == 1)
 			throw StandardException.newException(SQLState.LANG_DB2_INVALID_HEXADECIMAL_CONSTANT, StringUtil.formatForPrint(hexLiteral));
@@ -9538,7 +9538,7 @@
 }
 {
 	/* changed constraintName() to qualifiedName() for compaction */
-	<CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+	<CONSTRAINT> constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	{
 		return constraintName;
 	}
@@ -9623,7 +9623,7 @@
 	String newTableName;
 }
 {
-	<TABLE> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) <TO> newTableName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	<TABLE> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) <TO> newTableName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 								C_NodeTypes.RENAME_NODE,
@@ -9646,7 +9646,7 @@
 	String newIndexName;
 }
 {
-	<INDEX> oldIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) <TO> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
+	<INDEX> oldIndexName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) <TO> newIndexName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		QueryTreeNode qtn = nodeFactory.getNode(
 								C_NodeTypes.RENAME_NODE,
@@ -9670,7 +9670,7 @@
 	TableName					tableName;
 }
 {
-	<LOCK> <TABLE> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) <IN> exclusiveMode = lockMode() <MODE>
+	<LOCK> <TABLE> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) <IN> exclusiveMode = lockMode() <MODE>
 	{
 		return nodeFactory.getNode(
 								C_NodeTypes.LOCK_TABLE_NODE,
@@ -9702,7 +9702,7 @@
 	TableName	stmtName;
 }
 {
-	<EXECUTE> <STATEMENT> stmtName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	<EXECUTE> <STATEMENT> stmtName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 								C_NodeTypes.EXEC_SPS_NODE,
@@ -9886,9 +9886,9 @@
 		if (parameterList != null && parameterList.size() > 0)
 		{
 			setUpAndLinkParameters();
-			// set the type of parameter node, it should be a varchar max DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128 - non nullable
+			// set the type of parameter node, it should be a varchar max Limits.MAX_IDENTIFIER_LENGTH - non nullable
 			ParameterNode p = (ParameterNode)parameterList.elementAt(0);
-			p.setDescriptor(new DataTypeDescriptor(TypeId.getBuiltInTypeId(Types.VARCHAR), false, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128));
+			p.setDescriptor(new DataTypeDescriptor(TypeId.getBuiltInTypeId(Types.VARCHAR), false, Limits.MAX_IDENTIFIER_LENGTH));
 		}
 		return setSchema;
 	}
@@ -9910,7 +9910,7 @@
 	String schemaName;
 }
 {
-	schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
+	schemaName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 								C_NodeTypes.SET_SCHEMA_NODE,
@@ -9937,8 +9937,8 @@
 	}
 |	schemaName = string()
 	{
-		/* Max length for schema name is DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128 */
-		checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
+		/* Max length for schema name is Limits.MAX_IDENTIFIER_LENGTH */
+		checkIdentifierLengthLimit(schemaName, Limits.MAX_IDENTIFIER_LENGTH);
 		return (QueryTreeNode) nodeFactory.getNode(
 								C_NodeTypes.SET_SCHEMA_NODE,
 								schemaName,
@@ -10283,7 +10283,7 @@
 	TableName	tableName = null;
 }
 {
-	tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) [ <LEFT_PAREN> columnNameList(rcl) <RIGHT_PAREN> ]
+	tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) [ <LEFT_PAREN> columnNameList(rcl) <RIGHT_PAREN> ]
 	{
 		return tableName;
 	}
@@ -10477,7 +10477,7 @@
 	String schemaName;
 }
 {
-	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <RESTRICT>
+	<SCHEMA> schemaName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) <RESTRICT>
 	{
 		QueryTreeNode stmt =  nodeFactory.getNode(
 							C_NodeTypes.DROP_SCHEMA_NODE,
@@ -10496,7 +10496,7 @@
 	TableName			tableName;
 }
 {
-	<TABLE> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) node = alterTableBody(tableName)
+	<TABLE> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) node = alterTableBody(tableName)
 	{
 		return node;
 	}
@@ -10553,7 +10553,7 @@
 	String newTableName;
 }
 {
-	<TO> newTableName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	<TO> newTableName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 							C_NodeTypes.RENAME_NODE,
@@ -10578,7 +10578,7 @@
 	String newColumnName;
 }
 {
-	oldColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <TO> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
+	oldColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) <TO> newColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 							C_NodeTypes.RENAME_NODE,
@@ -10621,7 +10621,7 @@
 		return lockGranularity;
 	}
 |
-	<ALTER> [ <COLUMN> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <SET>
+	<ALTER> [ <COLUMN> ] columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) <SET>
 		typeDescriptor = DB2AlterColumn(autoIncrementInfo)
 	{
 		changeType[0] = CreateStatementNode.MODIFY_TYPE;
@@ -10681,7 +10681,7 @@
 	TableElementNode tn;
 }
 {
-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) tn = columnAlterClause(columnName)
+	columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) tn = columnAlterClause(columnName)
 	{
 		return tn;
 	}
@@ -10784,7 +10784,7 @@
 {
 	LOOKAHEAD( {getToken(2).kind == CONSTRAINT} )
 	/* changed constraintName() to qualifiedName() for compaction */
-	<DROP> <CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+	<DROP> <CONSTRAINT> constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	{
 		return (TableElementNode) nodeFactory.getNode(
 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
@@ -10816,7 +10816,7 @@
 	}
 |
 	LOOKAHEAD( {getToken(2).kind == FOREIGN} )
-        <DROP> <FOREIGN> <KEY> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+        <DROP> <FOREIGN> <KEY> constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	{
 		return (TableElementNode) nodeFactory.getNode(
 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
@@ -10833,7 +10833,7 @@
 	}
 |
 	LOOKAHEAD( {getToken(2).kind == UNIQUE} )
-        <DROP> <UNIQUE> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+        <DROP> <UNIQUE> constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	{
 		return (TableElementNode) nodeFactory.getNode(
 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
@@ -10849,7 +10849,7 @@
 						);
 	}
 |
-        <DROP> <CHECK> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+        <DROP> <CHECK> constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	{
 		return (TableElementNode) nodeFactory.getNode(
 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
@@ -10875,7 +10875,7 @@
 	TableName tableName;
 }
 {
-	<TABLE> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	<TABLE> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		// DB2 does not support a drop behaviour
 		return (QueryTreeNode) nodeFactory.getNode(
@@ -10895,7 +10895,7 @@
 	TableName indexName;
 }
 {
-	<INDEX> indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
+	<INDEX> indexName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH)
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 								C_NodeTypes.DROP_INDEX_NODE,
@@ -10913,11 +10913,11 @@
 	Object aliasName;
 }
 {
-  	<PROCEDURE> aliasName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+  	<PROCEDURE> aliasName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		return dropAliasNode(aliasName, AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR);
 	}  
-|  	<FUNCTION> aliasName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+|  	<FUNCTION> aliasName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		return dropAliasNode(aliasName, AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR);
 	}  
@@ -10929,7 +10929,7 @@
 	TableName viewName;
 }
 {
-	<VIEW> viewName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	<VIEW> viewName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 								C_NodeTypes.DROP_VIEW_NODE,
@@ -10944,7 +10944,7 @@
 	TableName triggerName;
 }
 {
-	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) 
+	<TRIGGER> triggerName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 								C_NodeTypes.DROP_TRIGGER_NODE,
@@ -10960,7 +10960,7 @@
 	TableName tableName;
 }
 {
-	<TRUNCATE> <TABLE> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
+	<TRUNCATE> <TABLE> tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH) 
 	{
 		return (QueryTreeNode) nodeFactory.getNode(
 							C_NodeTypes.ALTER_TABLE_NODE,
@@ -11463,7 +11463,7 @@
 	String str;
 }
 {
-	str = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
+	str = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
 	{
 		return str;
 	}

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java?rev=170069&r1=170068&r2=170069&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java Fri May 13 11:35:33 2005
@@ -59,7 +59,7 @@
 import org.apache.derby.iapi.sql.depend.DependencyManager;
 import org.apache.derby.iapi.sql.depend.Provider;
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.DB2Limit;
+import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.sql.execute.CursorActivation;
 import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
@@ -2084,7 +2084,7 @@
 		}
 
 		/* Maximum 16 nesting levels allowed */
-		if (triggerExecutionContexts.size() >= DB2Limit.DB2_MAX_TRIGGER_RECURSION)
+		if (triggerExecutionContexts.size() >= Limits.DB2_MAX_TRIGGER_RECURSION)
 		{
 			throw StandardException.newException(SQLState.LANG_TRIGGER_RECURSION_EXCEEDED);
 		}



Mime
View raw message