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 */
140140| <K_ALL:"ALL">
141141| <K_ALTER:"ALTER">
142142| <K_AND:"AND">
143+ | <K_AND_OPERATOR:"&&">
143144| <K_ANY:"ANY">
144145| <K_AS: "AS">
145146| <K_ASC:"ASC">
@@ -2015,7 +2016,7 @@ Expression AndExpression() :
20152016 { result = left; }
20162017
20172018 (
2018- <K_AND>
2019+ ( <K_AND> | <K_AND_OPERATOR>)
20192020 (
20202021 LOOKAHEAD(Condition())
20212022 right=Condition()
Original file line number Diff line number Diff line change @@ -3182,6 +3182,13 @@ public void testSqlContainIsNullFunctionShouldBeParsed() throws JSQLParserExcept
31823182 public void testNestedCast () throws JSQLParserException {
31833183 assertSqlCanBeParsedAndDeparsed ("SELECT acolumn::bit (64)::bigint FROM mytable" );
31843184 }
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+ }
31853192
31863193 @ Test
31873194 public void testNamedParametersIssue612 () throws Exception {
You can’t perform that action at this time.
0 commit comments