db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1428567 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/impl/sql/compile/ engine/org/apache/derby/loc/ shared/org/apache/derby/shared/common/reference/ testing/org/apache/derbyTesting/functio...
Date Thu, 03 Jan 2013 20:04:33 GMT
Author: rhillegas
Date: Thu Jan  3 20:04:33 2013
New Revision: 1428567

URL: http://svn.apache.org/viewvc?rev=1428567&view=rev
Log:
DERBY-6033: Remove the arbitrary limit on the number of parameters allowed for a Derby routine.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbManagerLimits.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java?rev=1428567&r1=1428566&r2=1428567&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java Thu Jan  3
20:04:33 2013
@@ -37,9 +37,6 @@ public interface Limits
 	/* 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 */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java?rev=1428567&r1=1428566&r2=1428567&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
Thu Jan  3 20:04:33 2013
@@ -211,10 +211,6 @@ public class CreateAliasNode extends DDL
 				TypeDescriptor[] types = null;
 				int[] modes = null;
 				
-				if (paramCount > Limits.DB2_MAX_PARAMS_IN_STORED_PROCEDURE)
-					throw StandardException.newException(SQLState.LANG_TOO_MANY_PARAMETERS_FOR_STORED_PROC,
-							String.valueOf(Limits.DB2_MAX_PARAMS_IN_STORED_PROCEDURE), aliasName, String.valueOf(paramCount));
-
 				if (paramCount != 0) {
 
 					names = new String[paramCount];

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?rev=1428567&r1=1428566&r2=1428567&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Thu Jan  3 20:04:33
2013
@@ -7484,14 +7484,6 @@ MessageId.java.
             </msg>
 
             <msg>
-                <name>54023</name>
-                <text>The limit for the number of parameters for a procedure has been
exceeded. Limit is {0} and number of parameters for procedure {1} are {2}.</text>
-                <arg>number</arg>
-                <arg>procedureName</arg>
-                <arg>number</arg>
-            </msg>
-
-            <msg>
                 <name>54038</name>
                 <text>Maximum depth of nested triggers was exceeded.</text>
             </msg>

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=1428567&r1=1428566&r2=1428567&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Thu Jan  3 20:04:33 2013
@@ -1141,7 +1141,6 @@ public interface SQLState {
 	String LANG_ALTER_TABLE_AUTOINCREMENT_COLUMN_NOT_ALLOWED           = "42601.S.372";
 	String LANG_TOO_MANY_INDEX_KEY_COLS                                = "54008";
 	String LANG_TRIGGER_RECURSION_EXCEEDED                             = "54038";
-	String LANG_TOO_MANY_PARAMETERS_FOR_STORED_PROC                    = "54023";
 
 	//following 1 does not match the DB2 sql state, it is a Derby specific behavior which is
not compatible with DB2
 	String LANG_OPERATION_NOT_ALLOWED_ON_SESSION_SCHEMA_TABLES = "XCL51.S";

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbManagerLimits.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbManagerLimits.out?rev=1428567&r1=1428566&r2=1428567&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbManagerLimits.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbManagerLimits.out
Thu Jan  3 20:04:33 2013
@@ -59,4 +59,4 @@ First create a procedure with one parame
 Next create a procedure with maximum allowed number of parameters
 Found 90 columns/parameters through meta data
 And finally create a procedure with more parameters that maximum allowed number of parameters
-expected exception The limit for the number of parameters for a procedure has been exceeded.
Limit is 90 and number of parameters for procedure P3 are 91.
+Found 91 columns/parameters through meta data

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java?rev=1428567&r1=1428566&r2=1428567&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits.java
Thu Jan  3 20:04:33 2013
@@ -533,8 +533,9 @@ public class dbManagerLimits
 			StringBuffer sbExecuteProcParams = new StringBuffer();
 			String tempString = new String();
 			int i = 0;
+            int oldDB2Limits = 90;
 
-			for (i = 0; i < Limits.DB2_MAX_PARAMS_IN_STORED_PROCEDURE-2; i++) {
+			for (i = 0; i < oldDB2Limits-2; i++) {
 				sbCreateProcParams.append("i" + i + " int, ");
 				sbExecuteProcParams.append("1, ");
 			}
@@ -552,19 +553,13 @@ public class dbManagerLimits
 			DatabaseMetaData met = conn.getMetaData();
 			getCount(met.getProcedureColumns("", "APP", "P2", null));
 
+            // This now succeeds because of the work done on DERBY-6033.
 			System.out.println("And finally create a procedure with more parameters that maximum allowed
number of parameters");
 			tempString = "create procedure P3(" + sbCreateProcParams.toString() + "i" + i +
         " int, i" + (i+1) + " int, i" + (i+2) + " int) parameter style java language java
external name \'org.apache.derbyTesting.functionTests.util.ProcedureTest.moreThanMaxAllowedParams\'
NO SQL";
-			try {
-				s.executeUpdate(tempString);
-				System.out.println("FAIL - create procedure should have failed");
-			}
-			catch (SQLException e) {
-				if (e.getSQLState().equals("54023"))
-					System.out.println("expected exception " + e.getMessage());
-				else
-					dumpSQLExceptions(e);
-			}
+            s.executeUpdate(tempString);
+			getCount(met.getProcedureColumns("", "APP", "P3", null));
+            
 		} catch (SQLException sqle) {
 			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(System.out, sqle);
 			sqle.printStackTrace(System.out);



Mime
View raw message