db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1616335 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/MethodCallNode.java testing/org/apache/derbyTesting/functionTests/tests/lang/OLAPTest.java
Date Wed, 06 Aug 2014 20:02:23 GMT
Author: dag
Date: Wed Aug  6 20:02:23 2014
New Revision: 1616335

URL: http://svn.apache.org/r1616335
Log:
DERBY-6691 ROW_NUMBER should not be allowed as argument in a procedure call

Patch *derby-6691* makes this usage throw 42ZC2 and adds a test to
OLAPTest#testBasicOperations.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OLAPTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java?rev=1616335&r1=1616334&r2=1616335&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
Wed Aug  6 20:02:23 2014
@@ -317,6 +317,7 @@ abstract class MethodCallNode extends Ja
 					if (routineInfo == null)
 						signature[ parm ] = methodParms[ parm ].getJSQLType();
                     
+                    SelectNode.checkNoWindowFunctions(methodParms[parm], "method argument");
 				}
 			}
 		}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OLAPTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OLAPTest.java?rev=1616335&r1=1616334&r2=1616335&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OLAPTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OLAPTest.java
Wed Aug  6 20:02:23 2014
@@ -611,19 +611,28 @@ public class OLAPTest extends BaseJDBCTe
         // Used to work before
         JDBC.assertFullResultSet(s.executeQuery(
             "select * from  " +
-            "    (select y from t3 order by row_number() over () fetch first 1 row only)
tt"),
+            "    (select y from t3 order by row_number() over () " + 
+            "     fetch first 1 row only) tt"),
             new String[][]{{"0"}});
 
         // failed prior to DERBY-6688
         JDBC.assertFullResultSet(s.executeQuery(
             "select * from t3 where y = " +
-                "    (select y from t3 order by row_number() over () fetch first row only)"),
+            "    (select y from t3 order by row_number() over () " + 
+            "     fetch first row only)"),
             new String[][]{{"0"}});
 
-        // DERBY-6689: NPE before
+        // DERBY-6689: ArrayIndexOutOfBoundsException before
         assertStatementError(LANG_WINDOW_FUNCTION_CONTEXT_ERROR,
             s,
-            "merge into t2 using t3 on (t2.x=t3.y) when not matched then insert values (row_number()
over ())");
+            "merge into t2 using t3 on (t2.x=t3.y) when not matched then " + 
+            "    insert values (row_number() over ())");
+        
+        // DERBY-6691: NPE before
+        assertStatementError(LANG_WINDOW_FUNCTION_CONTEXT_ERROR,
+            s,
+            "call syscs_util.syscs_compress_table(" + 
+            "    'APP', 'T2', row_number() over ())");
     }
 
 



Mime
View raw message