File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
140
140
| <K_ALL:"ALL">
141
141
| <K_ALTER:"ALTER">
142
142
| <K_AND:"AND">
143
+ | <K_AND_OPERATOR:"&&">
143
144
| <K_ANY:"ANY">
144
145
| <K_AS: "AS">
145
146
| <K_ASC:"ASC">
@@ -2015,7 +2016,7 @@ Expression AndExpression() :
2015
2016
{ result = left; }
2016
2017
2017
2018
(
2018
- <K_AND>
2019
+ ( <K_AND> | <K_AND_OPERATOR>)
2019
2020
(
2020
2021
LOOKAHEAD(Condition())
2021
2022
right=Condition()
Original file line number Diff line number Diff line change @@ -3182,6 +3182,13 @@ public void testSqlContainIsNullFunctionShouldBeParsed() throws JSQLParserExcept
3182
3182
public void testNestedCast () throws JSQLParserException {
3183
3183
assertSqlCanBeParsedAndDeparsed ("SELECT acolumn::bit (64)::bigint FROM mytable" );
3184
3184
}
3185
+
3186
+ @ Test
3187
+ public void testAndOperator () throws JSQLParserException {
3188
+ String stmt = "SELECT name from customers where name = 'John' && lastname = 'Doh'" ;
3189
+ Statement parsed = parserManager .parse (new StringReader (stmt ));
3190
+ assertStatementCanBeDeparsedAs (parsed , "SELECT name FROM customers WHERE name = 'John' AND lastname = 'Doh'" );
3191
+ }
3185
3192
3186
3193
@ Test
3187
3194
public void testNamedParametersIssue612 () throws Exception {
You can’t perform that action at this time.
0 commit comments