Skip to content

Commit

Permalink
fix: parsing SelectItem shall support Xor
Browse files Browse the repository at this point in the history
- fixes #1980

Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
  • Loading branch information
manticore-projects committed Mar 22, 2024
1 parent 86c6f5f commit c883920
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,7 @@ SelectItem SelectItem() #SelectItem:
|
LOOKAHEAD(AllTableColumns()) expression = AllTableColumns()
|
LOOKAHEAD( Condition() ) expression = Condition()
LOOKAHEAD( 3 ) expression = XorExpression()
|
LOOKAHEAD( 3 ) expression = ConcatExpression()
|
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/net/sf/jsqlparser/expression/operators/XorTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.sf.jsqlparser.expression.operators;

import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.test.TestUtils;
import org.junit.jupiter.api.Test;

public class XorTest {

@Test
void testXorIssue1980() throws JSQLParserException {
String sqlStr = "SELECT a or b from c";
TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
}
}

0 comments on commit c883920

Please sign in to comment.