Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for boolean 'XOR' operator #1193

Merged
merged 9 commits into from
Jun 2, 2021
Merged

Add support for boolean 'XOR' operator #1193

merged 9 commits into from
Jun 2, 2021

Conversation

arh-eu
Copy link
Contributor

@arh-eu arh-eu commented May 11, 2021

The boolean operator XOR (exclusive or) is not part of the SQL standard, but many databases have support for them (ex. mySQL).
However, with the current parser these expressions cannot be parsed as the keyword and the expression for it is not part of the grammar.

This pull request adds support for the XOR Expression, that is treated as a Binary Conditional Operator.
The expression behaves the same as the usual AND or OR expressions, but its precedence is the lowest: AND > OR > XOR.

@coveralls
Copy link

coveralls commented May 11, 2021

Coverage Status

Coverage increased (+0.06%) to 88.544% when pulling 77c30b8 on arh-eu:master into 86b613c on JSQLParser:master.

@arh-eu arh-eu requested a review from wumpz May 26, 2021 14:34
@wumpz
Copy link
Member

wumpz commented May 26, 2021

Are you sure you implemented the right precedence?

@arh-eu
Copy link
Contributor Author

arh-eu commented May 27, 2021

I've added new tests to showcase the precedence and associativity.

@arh-eu
Copy link
Contributor Author

arh-eu commented May 31, 2021

@wumpz Could you please review it again?

@wumpz wumpz merged commit c783240 into JSQLParser:master Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants