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">
@@ -1985,7 +1986,7 @@ Expression AndExpression() :
19851986 { result = left; }
19861987
19871988 (
1988- <K_AND>
1989+ ( <K_AND> | <K_AND_OPERATOR>)
19891990 (
19901991 LOOKAHEAD(Condition())
19911992 right=Condition()
Original file line number Diff line number Diff line change @@ -3166,4 +3166,11 @@ public void testSqlContainIsNullFunctionShouldBeParsed() throws JSQLParserExcept
31663166 public void testNestedCast () throws JSQLParserException {
31673167 assertSqlCanBeParsedAndDeparsed ("SELECT acolumn::bit (64)::bigint FROM mytable" );
31683168 }
3169+
3170+ @ Test
3171+ public void testAndOperator () throws JSQLParserException {
3172+ String stmt = "SELECT name from customers where name = 'John' && lastname = 'Doh'" ;
3173+ Statement parsed = parserManager .parse (new StringReader (stmt ));
3174+ assertStatementCanBeDeparsedAs (parsed , "SELECT name FROM customers WHERE name = 'John' AND lastname = 'Doh'" );
3175+ }
31693176}
You can’t perform that action at this time.
0 commit comments