File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -2546,14 +2546,14 @@ ExpressionList SimpleExpressionList() #ExpressionList:
2546
2546
}
2547
2547
}
2548
2548
2549
- ExpressionList ConditionExpressionList () #ExpressionList:
2549
+ ExpressionList ComplexExpressionList () #ExpressionList:
2550
2550
{
2551
2551
ExpressionList retval = new ExpressionList();
2552
2552
List<Expression> expressions = new ArrayList<Expression>();
2553
2553
Expression expr = null;
2554
2554
}
2555
2555
{
2556
- expr=Condition () { expressions.add(expr); } ("," expr=Condition () { expressions.add(expr); })*
2556
+ expr=Expression () { expressions.add(expr); } ("," expr=Expression () { expressions.add(expr); })*
2557
2557
{
2558
2558
retval.setExpressions(expressions);
2559
2559
return retval;
@@ -3343,7 +3343,7 @@ Function FunctionWithCondParams() #Function: {
3343
3343
(token = <K_IF> | token = <K_IIF>) { funcName=token.image; }
3344
3344
3345
3345
"("
3346
- expressionList=ConditionExpressionList ()
3346
+ expressionList=ComplexExpressionList ()
3347
3347
")"
3348
3348
3349
3349
{
Original file line number Diff line number Diff line change @@ -3809,4 +3809,24 @@ public void testIssue842() throws JSQLParserException {
3809
3809
public void testIssue842_2 () throws JSQLParserException {
3810
3810
assertSqlCanBeParsedAndDeparsed ("SELECT INTERVAL a.repayment_period DAY" );
3811
3811
}
3812
+
3813
+ @ Test
3814
+ public void testIssue848 () throws JSQLParserException {
3815
+ assertSqlCanBeParsedAndDeparsed ("SELECT IF(USER_ID > 10 AND SEX = 1, 1, 0)" );
3816
+ }
3817
+
3818
+ @ Test
3819
+ public void testIssue848_2 () throws JSQLParserException {
3820
+ assertSqlCanBeParsedAndDeparsed ("SELECT IF(USER_ID > 10, 1, 0)" );
3821
+ }
3822
+
3823
+ @ Test
3824
+ public void testIssue848_3 () throws JSQLParserException {
3825
+ assertSqlCanBeParsedAndDeparsed ("SELECT c1, multiset(SELECT * FROM mytable WHERE cond = 10) FROM T1 WHERE cond2 = 20" );
3826
+ }
3827
+
3828
+ @ Test
3829
+ public void testIssue848_4 () throws JSQLParserException {
3830
+ assertSqlCanBeParsedAndDeparsed ("select c1 from T1 where someFunc(select f1 from t2 where t2.id = T1.key) = 10" , true );
3831
+ }
3812
3832
}
You can’t perform that action at this time.
0 commit comments