File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -4291,7 +4291,7 @@ Expression CaseWhenExpression() #CaseWhenExpression:
42914291 [ switchExp=Condition() ]
42924292 ( clause=WhenThenSearchCondition() { whenClauses.add(clause); } )+
42934293 [<K_ELSE> (LOOKAHEAD( ["("] CaseWhenExpression() [")"] ( <K_WHEN> | <K_ELSE> | <K_END> ) ) ["("] elseExp=CaseWhenExpression() [")" { ((CaseExpression) elseExp).setUsingBrackets(true); } ]
4294- | elseExp=Condition ()
4294+ | elseExp=Expression ()
42954295 )
42964296 ]
42974297 <K_END> { caseCounter--; }
@@ -4323,21 +4323,6 @@ WhenClause WhenThenSearchCondition():
43234323 }
43244324}
43254325
4326- /*WhenClause WhenThenValue():
4327- {
4328- WhenClause whenThen = new WhenClause();
4329- Expression whenExp = null;
4330- Expression thenExp = null;
4331- }
4332- {
4333- <K_WHEN> whenExp=SimpleExpression() <K_THEN> thenExp=SimpleExpression()
4334- {
4335- whenThen.setWhenExpression(whenExp);
4336- whenThen.setThenExpression(thenExp);
4337- return whenThen;
4338- }
4339- }*/
4340-
43414326RowConstructor RowConstructor(): {
43424327 RowConstructor rowConstructor = new RowConstructor();
43434328 ColumnDefinition columnDefinition = null;
Original file line number Diff line number Diff line change @@ -4891,6 +4891,11 @@ public void testCanCallSubSelectOnWithItemEvenIfNotSetIssue1369() {
48914891 }
48924892
48934893 @ Test
4894+ public void testCaseElseExpressionIssue1375 () throws JSQLParserException {
4895+ assertSqlCanBeParsedAndDeparsed (
4896+ "SELECT * FROM t1 WHERE CASE WHEN 1 = 1 THEN c1 = 'a' ELSE c2 = 'b' AND c4 = 'd' END" , true );
4897+ }
4898+
48944899 public void testComplexInExpressionIssue905 () throws JSQLParserException {
48954900 assertSqlCanBeParsedAndDeparsed (
48964901 "select * " +
You can’t perform that action at this time.
0 commit comments