Skip to content

Commit 8c7ee28

Browse files
AnEmortalKidJan Monterrubiowumpz
authored
support IN with value (#1065)
Co-authored-by: Jan Monterrubio <[email protected]> Co-authored-by: Tobias <[email protected]>
1 parent ece8a5a commit 8c7ee28

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2735,9 +2735,10 @@ Expression InExpression() #InExpression :
27352735
(
27362736
// syntactic lookahead for a multi expression list, ie: ((a,b),(c,d))
27372737
LOOKAHEAD(3) multiExpressionList = MultiInExpressions()
2738-
| rightExpression = Function()
2738+
| LOOKAHEAD(Function()) rightExpression = Function()
27392739
| token=<S_CHAR_LITERAL> { rightExpression = new StringValue(token.image); }
27402740
| "(" (LOOKAHEAD(3) rightItemsList=SubSelect() | rightItemsList=SimpleExpressionList() )")"
2741+
| rightExpression = SimpleExpression()
27412742
)
27422743
{
27432744
result.setRightItemsList(rightItemsList);

src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4321,11 +4321,15 @@ public void testIssue1062() throws JSQLParserException {
43214321
public void testIssue1062_2() throws JSQLParserException {
43224322
assertSqlCanBeParsedAndDeparsed("SELECT * FROM mytable WHERE temperature.timestamp <= @until AND temperature.timestamp >= @from");
43234323
}
4324-
4324+
43254325
@Test
43264326
public void testIssue1068() throws JSQLParserException {
43274327
assertSqlCanBeParsedAndDeparsed("SELECT t2.c AS div");
43284328
}
4329+
4330+
@Test
4331+
public void selectWithSingleIn() throws JSQLParserException {
4332+
assertSqlCanBeParsedAndDeparsed("SELECT 1 FROM dual WHERE a IN 1");
43294333

43304334
@Test
43314335
public void testKeywordSequenceIssue1075() throws JSQLParserException {
@@ -4334,6 +4338,5 @@ public void testKeywordSequenceIssue1075() throws JSQLParserException {
43344338

43354339
@Test
43364340
public void testKeywordSequenceIssue1074() throws JSQLParserException {
4337-
assertSqlCanBeParsedAndDeparsed("SELECT * FROM t_user WITH (NOLOCK)");
43384341
}
43394342
}

0 commit comments

Comments
 (0)