Skip to content

Commit dbbaa0e

Browse files
fix long standing bug with CASE statements
should not need parenthesis when arithmethic or string operates are used in a THEN/ELSE expression.
1 parent d4ef024 commit dbbaa0e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

query/src/org/labkey/query/QueryTestCase.jsp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,10 @@ d,seven,twelve,day,month,date,duration,guid
911911
assertFalse(rs.getColumn(1).isHidden());
912912
assertEquals("0.00", rs.getColumn(1).getFormat());
913913
}
914-
}
914+
},
915915
916+
// test operators in WHEN expression
917+
new SqlTest("SELECT CASE WHEN 1=1 THEN 'a' || 'b' ELSE CASE WHEN (2=2) THEN 'two' ELSE NULL END END")
916918
);
917919
918920
List<SqlTest> postgres = List.of(

0 commit comments

Comments
 (0)