File tree Expand file tree Collapse file tree 3 files changed +22
-14
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/expression/operators/relational Expand file tree Collapse file tree 3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -104,14 +104,14 @@ dependencies {
104
104
testImplementation ' org.junit.jupiter:junit-jupiter-params:5.11.4'
105
105
106
106
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
107
- testImplementation ' org.mockito:mockito-junit-jupiter:+ '
107
+ testImplementation ' org.mockito:mockito-junit-jupiter:5.18.0 '
108
108
109
109
// Performance Benchmark
110
110
testImplementation ' org.openjdk.jmh:jmh-core:+'
111
111
testImplementation ' org.openjdk.jmh:jmh-generator-annprocess:+'
112
112
113
113
// Java Doc in XML Format
114
- xmlDoclet ' com.manticore-projects.tools:xml-doclet:+'
114
+ xmlDoclet ' com.manticore-projects.tools:xml-doclet:2. +'
115
115
116
116
// enforce latest version of JavaCC
117
117
testImplementation ' net.java.dev.javacc:javacc:+'
Original file line number Diff line number Diff line change @@ -4366,13 +4366,9 @@ WithIsolation WithIsolation():
4366
4366
JdbcParameter jdbc;
4367
4367
}
4368
4368
{
4369
- (
4370
- //with (ur | cs | rs | rr)
4371
- <K_WITH>
4372
- token=<K_ISOLATION> { withIsolation.setIsolation(token.image); }
4373
-
4374
- )
4375
- {
4369
+ <K_WITH>
4370
+ token=<K_ISOLATION>
4371
+ { withIsolation.setIsolation(token.image);
4376
4372
return withIsolation;
4377
4373
}
4378
4374
}
@@ -4434,10 +4430,11 @@ Skip Skip():
4434
4430
{
4435
4431
<K_SKIP>
4436
4432
(
4437
- token=<S_LONG> { skip.setRowCount(Long.parseLong(token.image)); }
4438
- | token=<S_IDENTIFIER> { skip.setVariable(token.image); }
4439
- | jdbc = JdbcParameter() { skip.setJdbcParameter(jdbc); }
4440
- /* "?" { skip.setJdbcParameter(new JdbcParameter(++jdbcParameterIndex, false)); } [ LOOKAHEAD(2) token = <S_LONG> { skip.getJdbcParameter().setUseFixedIndex(true); skip.getJdbcParameter().setIndex(Integer.valueOf(token.image)); } ] */
4433
+ token=<S_LONG> { skip.setRowCount(Long.parseLong(token.image)); }
4434
+ |
4435
+ token=<S_IDENTIFIER> { skip.setVariable(token.image); }
4436
+ |
4437
+ jdbc = JdbcParameter() { skip.setJdbcParameter(jdbc); }
4441
4438
)
4442
4439
{
4443
4440
return skip;
@@ -4733,7 +4730,7 @@ Expression InExpression(Expression leftExpression) #InExpression :
4733
4730
(
4734
4731
LOOKAHEAD(2) token=<S_CHAR_LITERAL> { rightExpression = new StringValue(token.image); }
4735
4732
|
4736
- rightExpression = Expression ()
4733
+ rightExpression = PrimaryExpression ()
4737
4734
)
4738
4735
{
4739
4736
InExpression inExpression = new InExpression(leftExpression, rightExpression)
Original file line number Diff line number Diff line change 10
10
package net .sf .jsqlparser .expression .operators .relational ;
11
11
12
12
import net .sf .jsqlparser .JSQLParserException ;
13
+ import net .sf .jsqlparser .expression .operators .conditional .OrExpression ;
14
+ import net .sf .jsqlparser .statement .select .PlainSelect ;
13
15
import net .sf .jsqlparser .test .TestUtils ;
16
+ import org .junit .jupiter .api .Assertions ;
14
17
import org .junit .jupiter .api .Test ;
15
18
16
19
import static org .junit .jupiter .api .Assertions .*;
@@ -30,4 +33,12 @@ void testOracleInWithBrackets() throws JSQLParserException {
30
33
TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
31
34
}
32
35
36
+ @ Test
37
+ void testPrecedenceIssue2244 () throws JSQLParserException {
38
+ String sqlStr = "select * from `T_DEMO` where a in (1,3,2) or b = 2" ;
39
+ PlainSelect select = (PlainSelect ) TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
40
+
41
+ Assertions .assertInstanceOf (OrExpression .class , select .getWhere ());
42
+ }
43
+
33
44
}
You can’t perform that action at this time.
0 commit comments