Index: java/tools/org/apache/derby/tools/dblook.java =================================================================== --- java/tools/org/apache/derby/tools/dblook.java (revision 122555) +++ java/tools/org/apache/derby/tools/dblook.java (working copy) @@ -37,6 +37,7 @@ import java.util.ArrayList; import org.apache.derby.iapi.tools.i18n.LocalizedResource; +import org.apache.derby.iapi.reference.DerbyLimit; import org.apache.derby.impl.tools.dblook.DB_Check; import org.apache.derby.impl.tools.dblook.DB_Index; @@ -51,11 +52,7 @@ public class dblook { - // DB2 enforces a maximum of 30 tables to be specified as part of - // the table list. - public static final int DB2_MAX_NUMBER_OF_TABLES = 30; - - private Connection conn; + private Connection conn; private static PreparedStatement getColNameFromNumberQuery; // Mappings from id to name for schemas and tables (for ease @@ -430,7 +427,7 @@ while (argIndex < args.length) { if (((args[argIndex].length() > 0) && (args[argIndex].charAt(0) == '-')) || - (++count > DB2_MAX_NUMBER_OF_TABLES)) + (++count > DerbyLimit.DERBY_MAX_NUMBER_OF_TABLES)) // we're done with the table list. break; Index: java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.reference.SQLState; /** @@ -437,9 +437,9 @@ val = this.getScale(operator, leftType, rightType) + Math.max(lprec - lscale, rprec - rscale) + 1; - if (val > DB2Limit.MAX_DECIMAL_PRECISION_SCALE) + if (val > DerbyLimit.MAX_DECIMAL_PRECISION_SCALE) // then, like DB2, just set it to the max possible. - val = DB2Limit.MAX_DECIMAL_PRECISION_SCALE; + val = DerbyLimit.MAX_DECIMAL_PRECISION_SCALE; } if (val > Integer.MAX_VALUE) Index: java/engine/org/apache/derby/impl/sql/compile/SelectNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/SelectNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/SelectNode.java (working copy) @@ -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.DerbyLimit; 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() > DerbyLimit.DERBY_MAX_ELEMENTS_IN_SELECT_LIST) { throw StandardException.newException(SQLState.LANG_TOO_MANY_ELEMENTS); } Index: java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java (working copy) @@ -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.DerbyLimit; 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()) > DerbyLimit.DERBY_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(DerbyLimit.DERBY_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()) > DerbyLimit.DERBY_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(DerbyLimit.DERBY_MAX_INDEXES_ON_TABLE)); } if (numCheckConstraints > 0) Index: java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.sql.compile.CompilerContext; @@ -582,7 +582,7 @@ ValueNode defaultNode, String defaultText) { - if (defaultText.length() > DB2Limit.DB2_CHAR_MAXWIDTH) + if (defaultText.length() > DerbyLimit.DERBY_CHAR_MAXWIDTH) // DB2 spec says this isn't allowed. return false; @@ -624,13 +624,13 @@ // 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)); + DerbyLimit.MIN_COL_LENGTH_FOR_CURRENT_USER)); if ((defaultText.indexOf("schema") != -1) || (defaultText.indexOf("sqlid") != -1)) // DB2 enforces min length of 128. return (charCol && (columnDesc.getMaximumWidth() >= - DB2Limit.MIN_COL_LENGTH_FOR_CURRENT_SCHEMA)); + DerbyLimit.MIN_COL_LENGTH_FOR_CURRENT_SCHEMA)); // else, function not allowed. return false; Index: java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java (working copy) @@ -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.DerbyLimit; 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() > DerbyLimit.DERBY_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(DerbyLimit.DERBY_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) > DerbyLimit.DERBY_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(DerbyLimit.DERBY_MAX_INDEXES_ON_TABLE)); } if (numCheckConstraints > 0) Index: java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/CreateIndexNode.java (working copy) @@ -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.DerbyLimit; 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() > DerbyLimit.DERBY_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(DerbyLimit.DERBY_MAX_INDEXES_ON_TABLE)); } /* Validate the column name list */ Index: java/engine/org/apache/derby/impl/sql/compile/OrderByList.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/OrderByList.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/OrderByList.java (working copy) @@ -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.DerbyLimit; 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 > DerbyLimit.DERBY_MAX_ELEMENTS_IN_ORDER_BY) { throw StandardException.newException(SQLState.LANG_TOO_MANY_ELEMENTS); } Index: java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.sql.ResultSet; import org.apache.derby.iapi.sql.execute.ConstantAction; @@ -126,9 +126,9 @@ TypeDescriptor[] types = null; int[] modes = null; - if (paramCount > DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE) + if (paramCount > DerbyLimit.DERBY_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(DerbyLimit.DERBY_MAX_PARAMS_IN_STORED_PROCEDURE), aliasName, String.valueOf(paramCount)); if (paramCount != 0) { Index: java/engine/org/apache/derby/impl/sql/compile/GroupByList.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/GroupByList.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/GroupByList.java (working copy) @@ -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.DerbyLimit; 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 > DerbyLimit.DERBY_MAX_ELEMENTS_IN_GROUP_BY) { throw StandardException.newException(SQLState.LANG_TOO_MANY_ELEMENTS); } Index: java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.sql.compile.CompilerContext; import org.apache.derby.iapi.sql.compile.C_NodeTypes; @@ -306,13 +306,13 @@ switch (type) { case Types.BINARY: case Types.CHAR: - if (length > DB2Limit.DB2_CHAR_MAXWIDTH) + if (length > DerbyLimit.DERBY_CHAR_MAXWIDTH) valid = false; break; case Types.VARBINARY: case Types.VARCHAR: - if (length > DB2Limit.DB2_VARCHAR_MAXWIDTH) + if (length > DerbyLimit.DERBY_VARCHAR_MAXWIDTH) valid = false; break; @@ -2583,7 +2583,7 @@ return getDeleteNode(fromTable, tableName, whereClause); } | - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) [targetProperties = propertyList() ] [ whereToken = @@ -2648,8 +2648,8 @@ String cursorName = null; } { - //cursor names are limited to 18 characters - cursorName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) + //cursor names are limited to 128 characters + cursorName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { return (FromTable) nodeFactory.getNode( C_NodeTypes.CURRENT_OF_NODE, @@ -2760,7 +2760,7 @@ getContextManager()); } | - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (QueryTreeNode) tableName; } @@ -2831,7 +2831,7 @@ return getUpdateNode(fromTable, tableName, columnList, whereClause); } | - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) [targetProperties = propertyList() ] columnList = setClauseList() [ @@ -3020,18 +3020,18 @@ } { ( - savepointName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) (savepointStatementClause(savepointStatementClauses))+ + savepointName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, 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; } -| [ ] [ savepointName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) ] +| [ ] [ savepointName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) ] { savepointStatementType = 2; } -| [ ] savepointName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) +| [ ] savepointName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { savepointStatementType = 3; } @@ -3105,7 +3105,7 @@ Object[] declareTableClauses = new Object[3]; } { - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) +
tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) tableElementList = tableElementList() ( declareTableClause(declareTableClauses) ) + { @@ -3240,8 +3240,8 @@ */ /* identifier() used to be columnName() */ - //unqualified column names are limited to 30 characters - columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + //unqualified column names are limited to 128 characters + columnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) ( typeDescriptor = dataTypeDDL() ) [ defaultNode = defaultAndConstraints(typeDescriptor, tableElementList, columnName, autoIncrementInfo) ] @@ -3881,7 +3881,7 @@ // match DB2 limits of 1 to 2147483647 if ((specifiedLength > 0L) && - (specifiedLength <= DB2Limit.DB2_LOB_MAXWIDTH)) + (specifiedLength <= DerbyLimit.DERBY_LOB_MAXWIDTH)) { return (int)specifiedLength; } @@ -3889,7 +3889,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 DerbyLimit.DERBY_LOB_MAXWIDTH; } catch (NumberFormatException nfe) @@ -4091,7 +4091,7 @@ String secondName = null; } { - firstName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + firstName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) [ // This LOOKAHEAD is necessary because a selectSublist() // can be a qualifiedName.*. Make sure that the token after @@ -4099,7 +4099,7 @@ // optional element. LOOKAHEAD( {getToken(1).kind == PERIOD && getToken(2).kind != ASTERISK} ) - secondName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + secondName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) ] { if (secondName == null) @@ -4115,7 +4115,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, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); return (TableName) nodeFactory.getNode( nodeType, @@ -4358,7 +4358,7 @@ ) } ) - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { allResultColumn = (ResultColumn) nodeFactory.getNode( C_NodeTypes.ALL_RESULT_COLUMN, @@ -4418,8 +4418,8 @@ } { /* identifier() used to be columnName() */ - //unqualified column names are limited to 30 characters - [ ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + //unqualified column names are limited to 128 characters + [ ] columnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { return columnName; } @@ -6193,7 +6193,7 @@ MethodCallNode methodNode; } { - routineName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + routineName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) methodCallParameterList(parameterList) { @@ -6266,7 +6266,7 @@ ValueNode retval; } { - firstName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + firstName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) [ // This LOOKAHEAD is required because we have the following cases: // schema.table.column.method() @@ -6280,7 +6280,7 @@ getToken(1).kind == PERIOD && getToken(3).kind == PERIOD } ) - secondName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + secondName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) [ // See above: we don't want to mistake the method name for a // column name. @@ -6288,7 +6288,7 @@ getToken(1).kind == PERIOD && getToken(3).kind == PERIOD } ) - thirdName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + thirdName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) ] ] { @@ -6357,7 +6357,7 @@ TableName tabName = null; } { - firstName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + firstName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) [ // This LOOKAHEAD is needed to ensure that, if the identifier // after the PERIOD is a method name , we @@ -6366,7 +6366,7 @@ getToken(1).kind == PERIOD && getToken(3).kind != LEFT_PAREN } ) - secondName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + secondName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) [ // This LOOKAHEAD is needed to ensure that, if the identifier // after the PERIOD is a method name , we @@ -6375,7 +6375,7 @@ getToken(1).kind == PERIOD && getToken(3).kind != LEFT_PAREN } ) - thirdName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + thirdName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) ] ] { @@ -6402,12 +6402,12 @@ columnName = thirdName; } - //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); + //column name, schema name and table name can not be longer than 128 characters + checkIdentifierLengthLimit(columnName, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); if (schemaName != null) - checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30); + checkIdentifierLengthLimit(schemaName, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); if (tableName != null) - checkIdentifierLengthLimit(tableName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128); + checkIdentifierLengthLimit(tableName, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); if (tableName != null) { @@ -6518,11 +6518,11 @@ int columnPosition; } { - firstName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + firstName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) [ - secondName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + secondName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) [ - thirdName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, false) + thirdName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, false) ] ] { @@ -6549,12 +6549,12 @@ columnName = thirdName; } - //column name and schema name can not be longer than 30 characters and correlation name can not be longer than 128 characters - checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30); + //column name, schema name and correlation name can not be longer than 128 characters + checkIdentifierLengthLimit(columnName, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); if (schemaName != null) - checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30); + checkIdentifierLengthLimit(schemaName, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); if (correlationName != null) - checkIdentifierLengthLimit(correlationName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128); + checkIdentifierLengthLimit(correlationName, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); return (OrderByColumn) nodeFactory.getNode( C_NodeTypes.ORDER_BY_COLUMN, columnName, @@ -6632,8 +6632,8 @@ } { /* identifier() used to be columnName() */ - //unqualified column names are limited to 30 characters - columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + //unqualified column names are limited to 128 characters + columnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { columnList.addElement(columnName); } @@ -7436,7 +7436,7 @@ } | [ [ ] - correlationName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + correlationName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) [ derivedRCL = derivedColumnList() ] [tableProperties = propertyList() ] ] { @@ -7486,7 +7486,7 @@ */ /* identifier() used to be correlationName() */ LOOKAHEAD( { newInvocationFollows(1) } ) - javaToSQLNode = newInvocation() [ ] correlationName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + javaToSQLNode = newInvocation() [ ] correlationName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) [ derivedRCL = derivedColumnList() ] [ optionalTableClauses = optionalTableProperties() ] (LOOKAHEAD( { joinedTableExpressionFollows() } ) @@ -7526,7 +7526,7 @@ } | /* identifier() used to be correlationName() */ - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) optionalTableClauses = optionalTableClauses() (LOOKAHEAD( { joinedTableExpressionFollows() } ) joinTable = joinedTableExpression( @@ -7582,7 +7582,7 @@ getToken(2).kind == VALUES ) } ) - derivedTable = derivedTable() [ ] correlationName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + derivedTable = derivedTable() [ ] correlationName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) [ derivedRCL = derivedColumnList() ] [ optionalTableClauses = optionalTableProperties() ] ( LOOKAHEAD( { joinedTableExpressionFollows() } ) @@ -7681,8 +7681,8 @@ } { /* identifier() used to be columnName() */ - //unqualified column names are limited to 30 characters - columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + //unqualified column names are limited to 128 characters + columnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { /* ** Store the column names for the result columns in the @@ -7719,7 +7719,7 @@ } { /* identifier never ends with a space; appending a space meaning desc */ - columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) [ | {columnName = columnName + ' ';}] + columnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) [ | {columnName = columnName + ' ';}] { /* ** Store the column names for the index columns in the @@ -8094,7 +8094,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(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) setQuantifier() value = additiveExpression(null, 0, false) { return (ValueNode) nodeFactory.getNode( @@ -8310,7 +8310,7 @@ ** We are not currently handling character set ** specifications for schema, or schema bodies. */ - schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + schemaName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { if (schemaName.startsWith("SYS")) @@ -8337,7 +8337,7 @@ TableElementList tableElementList; } { -
tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) +
tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) tableElementList = tableElementList() [ properties = propertyList()] { @@ -8461,7 +8461,7 @@ ** production to get the grammar to work... */ [ unique = unique() ] - indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + indexName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) indexColumnList(indexColumnList) [ properties = propertyList()] { @@ -8542,7 +8542,7 @@ Object[] procedureElements = new Object[9]; } { - procedureName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + procedureName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) procedureElements[0] = procedureParameterList() ( routineElement(true, procedureElements) ) + { @@ -8567,7 +8567,7 @@ } { ( - clauseValue = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + clauseValue = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { clausePosition = 1; throw StandardException.newException(SQLState.NOT_IMPLEMENTED, "SPECIFIC identifier");} | [ ] drs = uint_value() @@ -8663,7 +8663,7 @@ } { inout = inoutParameter() - parameterName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + parameterName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) typeDescriptor = dataTypeDDL() { list[0].addElement(parameterName); @@ -8709,7 +8709,7 @@ Object[] functionElements = new Object[9]; } { - functionName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + functionName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) functionElements[0] = functionParameterList() functionElements[8] = dataTypeCommon() ( routineElement(false, functionElements) ) + @@ -8756,7 +8756,7 @@ Integer inout; } { - parameterName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + parameterName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) typeDescriptor = dataTypeDDL() { list[0].addElement(parameterName); @@ -8776,7 +8776,7 @@ Token endToken; } { - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) [ resultColumns = viewColumnList() ] queryExpression = queryExpression(null, Boolean.FALSE) { @@ -8839,10 +8839,10 @@ Vector refClause = null; } { - triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + triggerName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) isBefore = beforeOrAfter() triggerEvent = triggerEvent(triggerColumns) // { INSERT | DELETE | UPDATE [ colList ] } - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) [ refClause = triggerReferencingClause() ] // REFERENCING OLD/NEW AS isRow = rowOrStatement() @@ -8969,7 +8969,7 @@ { isNew = false; isRow = false;} ) - identifier = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + identifier = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { vector.addElement(new TriggerReferencingStruct(isRow, isNew, identifier)); } @@ -9272,7 +9272,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() > DerbyLimit.DERBY_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('.'); @@ -9445,7 +9445,7 @@ tok = { //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 > DerbyLimit.DERBY_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. */ @@ -9470,7 +9470,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 > DerbyLimit.DERBY_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)); @@ -9491,7 +9491,7 @@ } { /* changed constraintName() to qualifiedName() for compaction */ - constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + constraintName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return constraintName; } @@ -9576,7 +9576,7 @@ String newTableName; } { -
tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) newTableName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) +
tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) newTableName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.RENAME_NODE, @@ -9599,7 +9599,7 @@ String newIndexName; } { - oldIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) + oldIndexName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) newIndexName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { QueryTreeNode qtn = nodeFactory.getNode( C_NodeTypes.RENAME_NODE, @@ -9623,7 +9623,7 @@ TableName tableName; } { -
tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) exclusiveMode = lockMode() +
tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) exclusiveMode = lockMode() { return nodeFactory.getNode( C_NodeTypes.LOCK_TABLE_NODE, @@ -9659,7 +9659,7 @@ Token endToken; } { - stmtName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + stmtName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) [ LOOKAHEAD( { getToken(1).kind == USING } ) usingToken = usingClause = queryExpression(null, Boolean.FALSE) ] @@ -9865,9 +9865,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 DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128 - 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, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128)); } return setSchema; } @@ -9889,7 +9889,7 @@ String schemaName; } { - schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + schemaName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.SET_SCHEMA_NODE, @@ -9916,8 +9916,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 DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128 */ + checkIdentifierLengthLimit(schemaName, DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128); return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.SET_SCHEMA_NODE, schemaName, @@ -10262,7 +10262,7 @@ TableName tableName = null; } { - tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) [ columnNameList(rcl) ] + tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) [ columnNameList(rcl) ] { return tableName; } @@ -10456,7 +10456,7 @@ String schemaName; } { - schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + schemaName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { QueryTreeNode stmt = nodeFactory.getNode( C_NodeTypes.DROP_SCHEMA_NODE, @@ -10475,7 +10475,7 @@ TableName tableName; } { -
tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) node = alterTableBody(tableName) +
tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) node = alterTableBody(tableName) { return node; } @@ -10532,7 +10532,7 @@ String newTableName; } { - newTableName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + newTableName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.RENAME_NODE, @@ -10557,7 +10557,7 @@ String newColumnName; } { - oldColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + oldColumnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) newColumnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.RENAME_NODE, @@ -10600,7 +10600,7 @@ return lockGranularity; } | - [ ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) + [ ] columnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) typeDescriptor = DB2AlterColumn(autoIncrementInfo) { changeType[0] = CreateStatementNode.MODIFY_TYPE; @@ -10660,7 +10660,7 @@ TableElementNode tn; } { - columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) tn = columnAlterClause(columnName) + columnName = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) tn = columnAlterClause(columnName) { return tn; } @@ -10763,7 +10763,7 @@ { LOOKAHEAD( {getToken(2).kind == CONSTRAINT} ) /* changed constraintName() to qualifiedName() for compaction */ - constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + constraintName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (TableElementNode) nodeFactory.getNode( C_NodeTypes.CONSTRAINT_DEFINITION_NODE, @@ -10795,7 +10795,7 @@ } | LOOKAHEAD( {getToken(2).kind == FOREIGN} ) - constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + constraintName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (TableElementNode) nodeFactory.getNode( C_NodeTypes.CONSTRAINT_DEFINITION_NODE, @@ -10812,7 +10812,7 @@ } | LOOKAHEAD( {getToken(2).kind == UNIQUE} ) - constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + constraintName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (TableElementNode) nodeFactory.getNode( C_NodeTypes.CONSTRAINT_DEFINITION_NODE, @@ -10828,7 +10828,7 @@ ); } | - constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + constraintName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (TableElementNode) nodeFactory.getNode( C_NodeTypes.CONSTRAINT_DEFINITION_NODE, @@ -10854,7 +10854,7 @@ TableName tableName; } { -
tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) +
tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { // DB2 does not support a drop behaviour return (QueryTreeNode) nodeFactory.getNode( @@ -10874,7 +10874,7 @@ TableName indexName; } { - indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + indexName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.DROP_INDEX_NODE, @@ -10892,11 +10892,11 @@ Object aliasName; } { - aliasName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + aliasName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return dropAliasNode(aliasName, AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR); } -| aliasName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) +| aliasName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return dropAliasNode(aliasName, AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR); } @@ -10908,7 +10908,7 @@ TableName viewName; } { - viewName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + viewName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.DROP_VIEW_NODE, @@ -10923,7 +10923,7 @@ TableName statementName; } { - statementName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) + statementName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { QueryTreeNode stmt = nodeFactory.getNode( C_NodeTypes.DROP_SPS_NODE, @@ -10940,7 +10940,7 @@ TableName triggerName; } { - triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) + triggerName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.DROP_TRIGGER_NODE, @@ -10956,7 +10956,7 @@ TableName tableName; } { -
tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) +
tableName = qualifiedName(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128) { return (QueryTreeNode) nodeFactory.getNode( C_NodeTypes.ALTER_TABLE_NODE, @@ -11457,7 +11457,7 @@ String str; } { - str = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) + str = identifier(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128, true) { return str; } Index: java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java (working copy) @@ -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.DerbyLimit; 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() > DerbyLimit.DERBY_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(DerbyLimit.DERBY_MAX_COLUMNS_IN_VIEW)); } // for each column, stuff system.column Index: java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java =================================================================== --- java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/compile/ConcatenationOperatorNode.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.reference.ClassName; @@ -360,7 +360,7 @@ { case Types.CHAR: case Types.BINARY: - if (resultLength > DB2Limit.DB2_CHAR_MAXWIDTH) { + if (resultLength > DerbyLimit.DERBY_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; @@ -372,7 +372,7 @@ case Types.VARCHAR: case Types.VARBINARY: - if (resultLength > DB2Limit.DB2_CONCAT_VARCHAR_LENGTH) { + if (resultLength > DerbyLimit.DERBY_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; @@ -394,7 +394,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 > DerbyLimit.DERBY_CONCAT_VARCHAR_LENGTH) higherType = TypeId.LONGVARCHAR_NAME; break; @@ -408,7 +408,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 > DerbyLimit.DERBY_CONCAT_VARCHAR_LENGTH) higherType = TypeId.LONGVARBIT_NAME; break; Index: java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java =================================================================== --- java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.sql.execute.ConstantAction; import org.apache.derby.iapi.sql.execute.CursorActivation; import org.apache.derby.iapi.sql.execute.ExecPreparedStatement; @@ -2068,7 +2068,7 @@ } /* Maximum 16 nesting levels allowed */ - if (triggerExecutionContexts.size() >= DB2Limit.DB2_MAX_TRIGGER_RECURSION) + if (triggerExecutionContexts.size() >= DerbyLimit.DERBY_MAX_TRIGGER_RECURSION) { throw StandardException.newException(SQLState.LANG_TRIGGER_RECURSION_EXCEEDED); } Index: java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java =================================================================== --- java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java (working copy) @@ -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.DerbyLimit; 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(DerbyLimit.DERBY_VARCHAR_MAXWIDTH)) { // procedure argument names @@ -8193,7 +8193,7 @@ DataTypeDescriptor.getBuiltInDataTypeDescriptor( Types.VARCHAR, 128), DataTypeDescriptor.getBuiltInDataTypeDescriptor( - Types.VARCHAR, DB2Limit.DB2_VARCHAR_MAXWIDTH) + Types.VARCHAR, DerbyLimit.DERBY_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 DerbyLimit.DERBY_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, DerbyLimit.DERBY_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 DerbyLimit.DERBY_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, DerbyLimit.DERBY_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(DerbyLimit.DERBY_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, DerbyLimit.DERBY_VARCHAR_MAXWIDTH), tc); } @@ -8468,13 +8468,13 @@ 0, RoutineAliasInfo.CONTAINS_SQL, DataTypeDescriptor.getBuiltInDataTypeDescriptor( - Types.VARCHAR, DB2Limit.DB2_VARCHAR_MAXWIDTH), + Types.VARCHAR, DerbyLimit.DERBY_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, DerbyLimit.DERBY_LOB_MAXWIDTH), */ tc); } @@ -8822,7 +8822,7 @@ DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.INTEGER), DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.SMALLINT), DataTypeDescriptor.getBuiltInDataTypeDescriptor( - Types.VARCHAR, DB2Limit.DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH), + Types.VARCHAR, DerbyLimit.DERBY_JCC_MAX_EXCEPTION_PARAM_LENGTH), DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.CHAR, 8), DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.INTEGER), DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.INTEGER), Index: java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java =================================================================== --- java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java (revision 122555) +++ java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.services.uuid.UUIDFactory; import org.apache.derby.catalog.UUID; Index: java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java =================================================================== --- java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java (revision 122555) +++ java/engine/org/apache/derby/impl/load/ImportResultSetMetaData.java (working copy) @@ -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.DerbyLimit; class ImportResultSetMetaData extends VTIMetaDataTemplate { @@ -55,7 +55,7 @@ } public int getColumnDisplaySize(int column) { if (columnWidths == null) - return DB2Limit.DB2_VARCHAR_MAXWIDTH; + return DerbyLimit.DERBY_VARCHAR_MAXWIDTH; else return columnWidths[column-1]; } Index: java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java =================================================================== --- java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java (revision 122555) +++ java/engine/org/apache/derby/impl/jdbc/EmbedConnection30.java (working copy) @@ -28,7 +28,7 @@ import org.apache.derby.jdbc.Driver169; import org.apache.derby.iapi.reference.SQLState; -import org.apache.derby.iapi.reference.DB2Limit; +import org.apache.derby.iapi.reference.DerbyLimit; 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() > DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128)) + throw newSQLException(SQLState.LANG_IDENTIFIER_TOO_LONG, name, String.valueOf(DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128)); 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); Index: java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java =================================================================== --- java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java (revision 122555) +++ java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java (working copy) @@ -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.DerbyLimit; 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() > DerbyLimit.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 Index: java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java =================================================================== --- java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java (revision 122555) +++ java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java (working copy) @@ -45,7 +45,7 @@ import org.apache.derby.catalog.UUID; import org.apache.derby.iapi.reference.SQLState; -import org.apache.derby.iapi.reference.DB2Limit; +import org.apache.derby.iapi.reference.DerbyLimit; import org.apache.derby.iapi.reference.JDBC20Translation; import org.apache.derby.iapi.reference.JDBC30Translation; @@ -1108,7 +1108,7 @@ * @return max literal length */ public int getMaxColumnNameLength() { - return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30; + return DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128; } /** @@ -1173,7 +1173,7 @@ * @return max cursor name length in bytes */ public int getMaxCursorNameLength() { - return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18; + return DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128; } /** @@ -1191,7 +1191,7 @@ * @return max name length in bytes */ public int getMaxSchemaNameLength() { - return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30; + return DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128; } /** @@ -1200,7 +1200,7 @@ * @return max name length in bytes */ public int getMaxProcedureNameLength() { - return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128; + return DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128; } /** @@ -1256,7 +1256,7 @@ * @return max name length in bytes */ public int getMaxTableNameLength() { - return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128; + return DerbyLimit.DERBY_MAX_IDENTIFIER_LENGTH128; } /** @@ -1274,7 +1274,7 @@ * @return max name length in bytes */ public int getMaxUserNameLength() { - return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30; + return DerbyLimit.MAX_USERID_LENGTH; } //---------------------------------------------------------------------- Index: java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java =================================================================== --- java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java (revision 122555) +++ java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java (working copy) @@ -22,7 +22,7 @@ import org.apache.derby.iapi.reference.Property; -import org.apache.derby.iapi.reference.DB2Limit; +import org.apache.derby.iapi.reference.DerbyLimit; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.impl.store.raw.data.BaseContainer; @@ -1111,8 +1111,8 @@ pageSize = PropertyUtil.getServiceInt(tc, createArgs, Property.PAGE_SIZE_PARAMETER, - DB2Limit.DB2_MIN_PAGE_SIZE, - DB2Limit.DB2_MAX_PAGE_SIZE, + DerbyLimit.DERBY_MIN_PAGE_SIZE, + DerbyLimit.DERBY_MAX_PAGE_SIZE, RawStoreFactory.PAGE_SIZE_DEFAULT); // rather than throw error, just automatically set page size to Index: java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java =================================================================== --- java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java (revision 122555) +++ java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java (working copy) @@ -31,7 +31,7 @@ import org.apache.derby.iapi.error.StandardException; -import org.apache.derby.iapi.reference.DB2Limit; +import org.apache.derby.iapi.reference.DerbyLimit; /** * 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 = DerbyLimit.DEFAULT_DECIMAL_PRECISION; + public static final int DEFAULT_DECIMAL_SCALE = DerbyLimit.DEFAULT_DECIMAL_SCALE; + public static final int MAX_DECIMAL_PRECISION_SCALE = DerbyLimit.MAX_DECIMAL_PRECISION_SCALE; public static final int BOOLEAN_MAXWIDTH_AS_CHAR = 5; Index: java/engine/org/apache/derby/iapi/types/TypeId.java =================================================================== --- java/engine/org/apache/derby/iapi/types/TypeId.java (revision 122555) +++ java/engine/org/apache/derby/iapi/types/TypeId.java (working copy) @@ -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.DerbyLimit; 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 = DerbyLimit.MAX_DECIMAL_PRECISION_SCALE; + public static final int DECIMAL_SCALE = DerbyLimit.MAX_DECIMAL_PRECISION_SCALE; + public static final int DECIMAL_MAXWIDTH = DerbyLimit.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 = DerbyLimit.DERBY_CHAR_MAXWIDTH; + public static final int VARCHAR_MAXWIDTH = DerbyLimit.DERBY_VARCHAR_MAXWIDTH; + public static final int LONGVARCHAR_MAXWIDTH = DerbyLimit.DERBY_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 = DerbyLimit.DERBY_LONGVARCHAR_MAXWIDTH; + public static final int BIT_MAXWIDTH = DerbyLimit.DERBY_CHAR_MAXWIDTH; + public static final int VARBIT_MAXWIDTH = DerbyLimit.DERBY_VARCHAR_MAXWIDTH; + public static final int LONGVARBIT_MAXWIDTH = DerbyLimit.DERBY_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 Index: java/engine/org/apache/derby/iapi/types/NumberDataType.java =================================================================== --- java/engine/org/apache/derby/iapi/types/NumberDataType.java (revision 122555) +++ java/engine/org/apache/derby/iapi/types/NumberDataType.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.types.*; import java.math.BigDecimal; @@ -317,9 +317,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 < DerbyLimit.DERBY_SMALLEST_REAL) || (v > DerbyLimit.DERBY_LARGEST_REAL)) || + ((v > 0) && (v < DerbyLimit.DERBY_SMALLEST_POSITIVE_REAL)) || + ((v < 0) && (v > DerbyLimit.DERBY_LARGEST_NEGATIVE_REAL)) ) { throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, TypeId.REAL_NAME); } @@ -343,9 +343,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 < DerbyLimit.DERBY_SMALLEST_REAL) || (v > DerbyLimit.DERBY_LARGEST_REAL)) || + ((v > 0) && (v < DerbyLimit.DERBY_SMALLEST_POSITIVE_REAL)) || + ((v < 0) && (v > DerbyLimit.DERBY_LARGEST_NEGATIVE_REAL)) ) { throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, TypeId.REAL_NAME); } @@ -363,9 +363,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 < DerbyLimit.DERBY_SMALLEST_DOUBLE) || (v > DerbyLimit.DERBY_LARGEST_DOUBLE)) || + ((v > 0) && (v < DerbyLimit.DERBY_SMALLEST_POSITIVE_DOUBLE)) || + ((v < 0) && (v > DerbyLimit.DERBY_LARGEST_NEGATIVE_DOUBLE)) ) { throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, TypeId.DOUBLE_NAME); } Index: java/engine/org/apache/derby/iapi/reference/DerbyLimit.java =================================================================== --- java/engine/org/apache/derby/iapi/reference/DerbyLimit.java (revision 111709) +++ java/engine/org/apache/derby/iapi/reference/DerbyLimit.java (working copy) @@ -1,6 +1,6 @@ /* - Derby - Class org.apache.derby.iapi.reference.DB2Limit + Derby - Class org.apache.derby.iapi.reference.DerbyLimit Copyright 2004 The Apache Software Foundation or its licensors, as applicable. @@ -20,54 +20,49 @@ package org.apache.derby.iapi.reference; -public interface DB2Limit +public interface DerbyLimit { /** * Various fixed numbers related to DB2 limits. */ - public static final int DB2_MAX_TRIGGER_RECURSION = 16; /* Maximum nesting level for triggers */ + public static final int DERBY_MAX_TRIGGER_RECURSION = 16; /* Maximum nesting level for triggers */ /** Maximum number of indexes on a table */ - public static final int DB2_MAX_INDEXES_ON_TABLE = 32767; + public static final int DERBY_MAX_INDEXES_ON_TABLE = 32767; /* Maximum number of columns in a table */ - public static final int DB2_MAX_COLUMNS_IN_TABLE = 1012; + public static final int DERBY_MAX_COLUMNS_IN_TABLE = 1012; /* Maximum number of columns in a view */ - public static final int DB2_MAX_COLUMNS_IN_VIEW = 5000; + public static final int DERBY_MAX_COLUMNS_IN_VIEW = 5000; /* Maximum number of parameters in a stored procedure */ - public static final int DB2_MAX_PARAMS_IN_STORED_PROCEDURE = 90; + public static final int DERBY_MAX_PARAMS_IN_STORED_PROCEDURE = 90; /* Maximum number of elements in a select list */ - public static final int DB2_MAX_ELEMENTS_IN_SELECT_LIST = 1012; + public static final int DERBY_MAX_ELEMENTS_IN_SELECT_LIST = 1012; /* Maximum number of columns in a group by list */ - public static final int DB2_MAX_ELEMENTS_IN_GROUP_BY = 32677; + public static final int DERBY_MAX_ELEMENTS_IN_GROUP_BY = 32677; /* Maximum number of columns in an order by list */ - public static final int DB2_MAX_ELEMENTS_IN_ORDER_BY = 1012; + public static final int DERBY_MAX_ELEMENTS_IN_ORDER_BY = 1012; // Max length for an exception parameter string over CCC server. - public static final int DB2_CCC_MAX_EXCEPTION_PARAM_LENGTH = 70; + public static final int DERBY_CCC_MAX_EXCEPTION_PARAM_LENGTH = 70; // Warning. Changing this value will affect upgrade and the creation of the // SQLCAMESSAGE procedure. See org.apache.derby.impl.sql.catalog. - public static final int DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH = 2400; + public static final int DERBY_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; - public static final int DB2_CHAR_MAXWIDTH = 254; - public static final int DB2_VARCHAR_MAXWIDTH = 32672; - public static final int DB2_LOB_MAXWIDTH = 2147483647; - public static final int DB2_LONGVARCHAR_MAXWIDTH = 32700; - public static final int DB2_CONCAT_VARCHAR_LENGTH = 4000; - public static final int DB2_MAX_FLOATINGPOINT_LITERAL_LENGTH = 30; // note, this value 30 is also contained in err msg 42820 - public static final int DB2_MAX_CHARACTER_LITERAL_LENGTH = 32672; - public static final int DB2_MAX_HEX_LITERAL_LENGTH = 16336; + /* Some identifiers like Constraint name, Cursor name, Function name, Index name, Trigger name, Column name, Schema name, Savepoint names, Table names, view names etc are limited to 128 characters in DB2*/ + public static final int DERBY_MAX_IDENTIFIER_LENGTH128 = 128; + public static final int DERBY_CHAR_MAXWIDTH = 254; + public static final int DERBY_VARCHAR_MAXWIDTH = 32672; + public static final int DERBY_LOB_MAXWIDTH = 2147483647; + public static final int DERBY_LONGVARCHAR_MAXWIDTH = 32700; + public static final int DERBY_CONCAT_VARCHAR_LENGTH = 4000; + public static final int DERBY_MAX_FLOATINGPOINT_LITERAL_LENGTH = 30; // note, this value 30 is also contained in err msg 42820 + public static final int DERBY_MAX_CHARACTER_LITERAL_LENGTH = 32672; + public static final int DERBY_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; @@ -76,8 +71,8 @@ /** * DB2 TABLESPACE page size limits */ - public static final int DB2_MIN_PAGE_SIZE = 4096; // 4k - public static final int DB2_MAX_PAGE_SIZE = 32768; // 32k + public static final int DERBY_MIN_PAGE_SIZE = 4096; // 4k + public static final int DERBY_MAX_PAGE_SIZE = 32768; // 32k /** * DECIMAL type limits @@ -91,15 +86,16 @@ * REAL/DOUBLE range limits */ - static final float DB2_SMALLEST_REAL = -3.402E+38f; - static final float DB2_LARGEST_REAL = +3.402E+38f; - static final float DB2_SMALLEST_POSITIVE_REAL = +1.175E-37f; - static final float DB2_LARGEST_NEGATIVE_REAL = -1.175E-37f; + static final float DERBY_SMALLEST_REAL = -3.402E+38f; + static final float DERBY_LARGEST_REAL = +3.402E+38f; + static final float DERBY_SMALLEST_POSITIVE_REAL = +1.175E-37f; + static final float DERBY_LARGEST_NEGATIVE_REAL = -1.175E-37f; - static final double DB2_SMALLEST_DOUBLE = -1.79769E+308d; - static final double DB2_LARGEST_DOUBLE = +1.79769E+308d; - static final double DB2_SMALLEST_POSITIVE_DOUBLE = +2.225E-307d; - static final double DB2_LARGEST_NEGATIVE_DOUBLE = -2.225E-307d; + static final double DERBY_SMALLEST_DOUBLE = -1.79769E+308d; + static final double DERBY_LARGEST_DOUBLE = +1.79769E+308d; + static final double DERBY_SMALLEST_POSITIVE_DOUBLE = +2.225E-307d; + static final double DERBY_LARGEST_NEGATIVE_DOUBLE = -2.225E-307d; - + // Maximum number of tables to be specified as part of the table list. + public static final int DERBY_MAX_NUMBER_OF_TABLES = 30; } Index: java/engine/org/apache/derby/iapi/reference/DB2Limit.java =================================================================== --- java/engine/org/apache/derby/iapi/reference/DB2Limit.java (revision 122555) +++ java/engine/org/apache/derby/iapi/reference/DB2Limit.java (working copy) @@ -1,105 +0,0 @@ -/* - - Derby - Class org.apache.derby.iapi.reference.DB2Limit - - Copyright 2004 The Apache Software Foundation or its licensors, as applicable. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - */ - -package org.apache.derby.iapi.reference; - -public interface DB2Limit -{ - /** - * Various fixed numbers related to DB2 limits. - */ - - public static final int DB2_MAX_TRIGGER_RECURSION = 16; /* Maximum nesting level for triggers */ - - /** Maximum number of indexes on a table */ - public static final int DB2_MAX_INDEXES_ON_TABLE = 32767; - /* Maximum number of columns in a table */ - public static final int DB2_MAX_COLUMNS_IN_TABLE = 1012; - - /* Maximum number of columns in a view */ - public static final int DB2_MAX_COLUMNS_IN_VIEW = 5000; - - /* Maximum number of parameters in a stored procedure */ - public static final int DB2_MAX_PARAMS_IN_STORED_PROCEDURE = 90; - - /* Maximum number of elements in a select list */ - public static final int DB2_MAX_ELEMENTS_IN_SELECT_LIST = 1012; - /* Maximum number of columns in a group by list */ - public static final int DB2_MAX_ELEMENTS_IN_GROUP_BY = 32677; - /* Maximum number of columns in an order by list */ - public static final int DB2_MAX_ELEMENTS_IN_ORDER_BY = 1012; - - // Max length for an exception parameter string over CCC server. - public static final int DB2_CCC_MAX_EXCEPTION_PARAM_LENGTH = 70; - - // Warning. Changing this value will affect upgrade and the creation of the - // 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; - public static final int DB2_CHAR_MAXWIDTH = 254; - public static final int DB2_VARCHAR_MAXWIDTH = 32672; - public static final int DB2_LOB_MAXWIDTH = 2147483647; - public static final int DB2_LONGVARCHAR_MAXWIDTH = 32700; - public static final int DB2_CONCAT_VARCHAR_LENGTH = 4000; - public static final int DB2_MAX_FLOATINGPOINT_LITERAL_LENGTH = 30; // note, this value 30 is also contained in err msg 42820 - 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; - - /** - * DB2 TABLESPACE page size limits - */ - public static final int DB2_MIN_PAGE_SIZE = 4096; // 4k - public static final int DB2_MAX_PAGE_SIZE = 32768; // 32k - - /** - * 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; - - /** - * REAL/DOUBLE range limits - */ - - static final float DB2_SMALLEST_REAL = -3.402E+38f; - static final float DB2_LARGEST_REAL = +3.402E+38f; - static final float DB2_SMALLEST_POSITIVE_REAL = +1.175E-37f; - static final float DB2_LARGEST_NEGATIVE_REAL = -1.175E-37f; - - static final double DB2_SMALLEST_DOUBLE = -1.79769E+308d; - static final double DB2_LARGEST_DOUBLE = +1.79769E+308d; - static final double DB2_SMALLEST_POSITIVE_DOUBLE = +2.225E-307d; - static final double DB2_LARGEST_NEGATIVE_DOUBLE = -2.225E-307d; - - -} Index: java/engine/org/apache/derby/diag/ErrorMessages.java =================================================================== --- java/engine/org/apache/derby/diag/ErrorMessages.java (revision 122555) +++ java/engine/org/apache/derby/diag/ErrorMessages.java (working copy) @@ -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.DerbyLimit; 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, DerbyLimit.DERBY_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, DerbyLimit.DERBY_VARCHAR_MAXWIDTH), EmbedResultSetMetaData.getResultColumnDescriptor("SEVERITY", Types.INTEGER, true), }; Index: java/engine/org/apache/derby/diag/StatementCache.java =================================================================== --- java/engine/org/apache/derby/diag/StatementCache.java (revision 122555) +++ java/engine/org/apache/derby/diag/StatementCache.java (working copy) @@ -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.DerbyLimit; 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, DerbyLimit.DERBY_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, DerbyLimit.DERBY_VARCHAR_MAXWIDTH), EmbedResultSetMetaData.getResultColumnDescriptor("UNICODE", Types.BIT, false), EmbedResultSetMetaData.getResultColumnDescriptor("VALID", Types.BIT, false), EmbedResultSetMetaData.getResultColumnDescriptor("COMPILED_AT", Types.TIMESTAMP, true), Index: java/engine/org/apache/derby/diag/StatementDuration.java =================================================================== --- java/engine/org/apache/derby/diag/StatementDuration.java (revision 122555) +++ java/engine/org/apache/derby/diag/StatementDuration.java (working copy) @@ -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.DerbyLimit; import org.apache.derby.iapi.util.StringUtil; /** @@ -306,7 +306,7 @@ } } - output = StringUtil.truncate(output, DB2Limit.DB2_VARCHAR_MAXWIDTH); + output = StringUtil.truncate(output, DerbyLimit.DERBY_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, DerbyLimit.DERBY_VARCHAR_MAXWIDTH), EmbedResultSetMetaData.getResultColumnDescriptor("DURATION", Types.VARCHAR, false, 10), }; Index: java/engine/org/apache/derby/diag/TransactionTable.java =================================================================== --- java/engine/org/apache/derby/diag/TransactionTable.java (revision 122555) +++ java/engine/org/apache/derby/diag/TransactionTable.java (working copy) @@ -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.DerbyLimit; 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, DerbyLimit.DERBY_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, DerbyLimit.DERBY_VARCHAR_MAXWIDTH), }; private static final ResultSetMetaData metadata = new EmbedResultSetMetaData(columnInfo); Index: java/engine/org/apache/derby/diag/ErrorLogReader.java =================================================================== --- java/engine/org/apache/derby/diag/ErrorLogReader.java (revision 122555) +++ java/engine/org/apache/derby/diag/ErrorLogReader.java (working copy) @@ -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.DerbyLimit; 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, DerbyLimit.DERBY_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, DerbyLimit.DERBY_VARCHAR_MAXWIDTH) }; private static final ResultSetMetaData metadata = new EmbedResultSetMetaData(columnInfo); Index: java/drda/org/apache/derby/impl/drda/FdocaConstants.java =================================================================== --- java/drda/org/apache/derby/impl/drda/FdocaConstants.java (revision 122555) +++ java/drda/org/apache/derby/impl/drda/FdocaConstants.java (working copy) @@ -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.DerbyLimit; 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 = DerbyLimit.DERBY_LONGVARCHAR_MAXWIDTH; + protected static int LONGVARBINARY_MAX_LEN = DerbyLimit.DERBY_LONGVARCHAR_MAXWIDTH; protected static int LONGVARCHAR_LEN_NUMBYTES = 2; // JCC only supports a max precision of 31 like DB2 Index: java/drda/org/apache/derby/impl/drda/DRDAConnThread.java =================================================================== --- java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (revision 122555) +++ java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (working copy) @@ -56,7 +56,7 @@ import org.apache.derby.iapi.tools.i18n.LocalizedResource; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.reference.Attribute; -import org.apache.derby.iapi.reference.DB2Limit; +import org.apache.derby.iapi.reference.DerbyLimit; import org.apache.derby.iapi.error.ExceptionSeverity; import org.apache.derby.impl.jdbc.Util; import org.apache.derby.impl.jdbc.EmbedSQLException; Index: java/drda/org/apache/derby/impl/drda/AppRequester.java =================================================================== --- java/drda/org/apache/derby/impl/drda/AppRequester.java (revision 122555) +++ java/drda/org/apache/derby/impl/drda/AppRequester.java (working copy) @@ -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.DerbyLimit; /** AppRequester stores information about the application requester. @@ -228,12 +228,12 @@ switch (clientType) { case JCC_CLIENT: - return DB2Limit.DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH; + return DerbyLimit.DERBY_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 DerbyLimit.DERBY_CCC_MAX_EXCEPTION_PARAM_LENGTH; } Index: java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java =================================================================== --- java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java (revision 122555) +++ java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java (working copy) @@ -23,7 +23,7 @@ import java.sql.*; import org.apache.derby.tools.ij; -import org.apache.derby.iapi.reference.DB2Limit; +import org.apache.derby.iapi.reference.DerbyLimit; import org.apache.derbyTesting.functionTests.util.Formatters; /** @@ -206,7 +206,7 @@ String tempString = new String(); int i = 0; sbTableElements.append("create table t1 ("); - for (i = 0; i < DB2Limit.DB2_MAX_COLUMNS_IN_TABLE-2; i++) + for (i = 0; i < DerbyLimit.DERBY_MAX_COLUMNS_IN_TABLE-2; i++) sbTableElements.append("c" + i +" int, "); Statement s = conn.createStatement(); @@ -296,7 +296,7 @@ StringBuffer sbViewColumnNames = new StringBuffer(); String tempString = new String(); int i = 0; - for (i = 0; i < DB2Limit.DB2_MAX_COLUMNS_IN_VIEW-2; i++) { + for (i = 0; i < DerbyLimit.DERBY_MAX_COLUMNS_IN_VIEW-2; i++) { sbValuesClause.append(1 + ", "); sbViewColumnNames.append("c" + i + ", "); } @@ -355,7 +355,7 @@ String tempString = new String(); int i = 0; sb.append("create table t1 ("); - for (i = 0; i < DB2Limit.DB2_MAX_COLUMNS_IN_TABLE-2; i++) + for (i = 0; i < DerbyLimit.DERBY_MAX_COLUMNS_IN_TABLE-2; i++) sb.append("c" + i +" int, "); Statement s = conn.createStatement(); @@ -408,7 +408,7 @@ String tempString = new String(); int i = 0; sbOrderBy.append("select * from t1 order by "); - for (i = 0; i < DB2Limit.DB2_MAX_ELEMENTS_IN_ORDER_BY-2; i++) + for (i = 0; i < DerbyLimit.DERBY_MAX_ELEMENTS_IN_ORDER_BY-2; i++) sbOrderBy.append("c1, "); Statement s = conn.createStatement(); @@ -467,11 +467,11 @@ //first create 7 views with 5000 columns each int i = 0; - for (i = 0; i < DB2Limit.DB2_MAX_COLUMNS_IN_VIEW-1; i++) + for (i = 0; i < DerbyLimit.DERBY_MAX_COLUMNS_IN_VIEW-1; i++) sbValuesClause.append(1 + ", "); for (int j = 1; j < 8; j++) { - for (i = 0; i < DB2Limit.DB2_MAX_COLUMNS_IN_VIEW-1; i++) { + for (i = 0; i < DerbyLimit.DERBY_MAX_COLUMNS_IN_VIEW-1; i++) { sbViewColumnNames.append("c" + j + "" + i + ", "); } tempString = "create view v" + j + "(" + sbViewColumnNames.toString() + "c" + j + "" + i + ") as values (" + sbValuesClause.toString() + "1)"; @@ -480,7 +480,7 @@ } for (int j = 1; j < 7; j++) { - for (i = 0; i < DB2Limit.DB2_MAX_COLUMNS_IN_VIEW; i++) + for (i = 0; i < DerbyLimit.DERBY_MAX_COLUMNS_IN_VIEW; i++) sbGroupBy.append("c" + j + "" + i + ", "); } for (i = 0; i < 2675; i++) @@ -533,7 +533,7 @@ String tempString = new String(); int i = 0; - for (i = 0; i < DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE-2; i++) { + for (i = 0; i < DerbyLimit.DERBY_MAX_PARAMS_IN_STORED_PROCEDURE-2; i++) { sbCreateProcParams.append("i" + i + " int, "); sbExecuteProcParams.append("1, "); } @@ -584,7 +584,7 @@ s.executeUpdate("create table t1 (c1 int not null, c2 int, primary key(c1))"); System.out.println("First create one index less than maximum allowed number of indexes"); - for (i = 0; i < DB2Limit.DB2_MAX_INDEXES_ON_TABLE-2; i++) { + for (i = 0; i < DerbyLimit.DERBY_MAX_INDEXES_ON_TABLE-2; i++) { s.executeUpdate("create index i" + i + " on t1(c1,c2)"); System.out.println(" create index" + i); }