db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r551764 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java
Date Fri, 29 Jun 2007 02:30:52 GMT
Author: djd
Date: Thu Jun 28 19:30:51 2007
New Revision: 551764

URL: http://svn.apache.org/viewvc?view=rev&rev=551764
Log:
DERBY-2809 Add test cases for non-boolean unary operators in case expressions.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java?view=diff&rev=551764&r1=551763&r2=551764
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java
Thu Jun 28 19:30:51 2007
@@ -113,6 +113,28 @@
     public CaseExpressionTest(String name) {
         super(name);
     }
+    
+    /**
+     * Test various statements that 
+     *
+     */
+    public void testWhenNonBoolean() {
+        
+        // DERBY-2809: BOOLEAN datatype was forced upon
+        // unary expressions that were not BOOLEAN, such
+        // as SQRT(?)
+        String[] unaryOperators = {
+                "SQRT(?)", "SQRT(9)",
+                "UPPER(?)", "UPPER('haight')",
+                "LOWER(?)", "LOWER('HAIGHT')",
+        };
+        for (int i = 0; i < unaryOperators.length; i++)
+        {
+            assertCompileError("42X88",
+               "VALUES CASE WHEN " + unaryOperators[i] +
+               " THEN 3 ELSE 4 END");
+        }
+    }
 
     public void testAllDatatypesCombinationsForCaseExpressions()
     throws SQLException



Mime
View raw message