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:
4291
4291
[ switchExp=Condition() ]
4292
4292
( clause=WhenThenSearchCondition() { whenClauses.add(clause); } )+
4293
4293
[<K_ELSE> (LOOKAHEAD( ["("] CaseWhenExpression() [")"] ( <K_WHEN> | <K_ELSE> | <K_END> ) ) ["("] elseExp=CaseWhenExpression() [")" { ((CaseExpression) elseExp).setUsingBrackets(true); } ]
4294
- | elseExp=Condition ()
4294
+ | elseExp=Expression ()
4295
4295
)
4296
4296
]
4297
4297
<K_END> { caseCounter--; }
@@ -4323,21 +4323,6 @@ WhenClause WhenThenSearchCondition():
4323
4323
}
4324
4324
}
4325
4325
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
-
4341
4326
RowConstructor RowConstructor(): {
4342
4327
RowConstructor rowConstructor = new RowConstructor();
4343
4328
ColumnDefinition columnDefinition = null;
Original file line number Diff line number Diff line change @@ -4891,6 +4891,11 @@ public void testCanCallSubSelectOnWithItemEvenIfNotSetIssue1369() {
4891
4891
}
4892
4892
4893
4893
@ 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
+
4894
4899
public void testComplexInExpressionIssue905 () throws JSQLParserException {
4895
4900
assertSqlCanBeParsedAndDeparsed (
4896
4901
"select * " +
You can’t perform that action at this time.
0 commit comments