Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion query/src/org/labkey/query/QueryTestCase.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,10 @@ d,seven,twelve,day,month,date,duration,guid
assertFalse(rs.getColumn(1).isHidden());
assertEquals("0.00", rs.getColumn(1).getFormat());
}
}
},

// test operators in THEN expression
new SqlTest("SELECT CASE WHEN 1=1 THEN 'a' || 'b' ELSE 'x' || 'y' END")
);

List<SqlTest> postgres = List.of(
Expand Down
6 changes: 3 additions & 3 deletions query/src/org/labkey/query/sql/SqlBase.g
Original file line number Diff line number Diff line change
Expand Up @@ -729,15 +729,15 @@ caseExpression
;

whenClause
: (WHEN^ logicalExpression THEN! unaryExpression)
: (WHEN^ logicalExpression THEN! valueExpression)
;

altWhenClause
: (WHEN^ unaryExpression THEN! unaryExpression)
: (WHEN^ unaryExpression THEN! valueExpression)
;

elseClause
: (ELSE^ unaryExpression)
: (ELSE^ valueExpression)
;


Expand Down