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

Invalid NOT query can be parsed without an error while ignoreParseErrors is disabled #201

Open
1 of 2 tasks
ghingis opened this issue Jul 19, 2022 · 1 comment
Open
1 of 2 tasks

Comments

@ghingis
Copy link

ghingis commented Jul 19, 2022

  • Feature
  • Bug

Description

This is a valid query:

SELECT AnnualRevenue FROM Account WHERE Name <> NULL AND (NOT (AnnualRevenue > 0))

This is also a valid query:

SELECT AnnualRevenue FROM Account WHERE Name <> NULL AND (NOT AnnualRevenue > 0)

And this is not a valid query:

SELECT AnnualRevenue FROM Account WHERE Name <> NULL AND NOT (AnnualRevenue > 0)

This will throw a unexpected token: 'NOT' on Salesforce.

Yet the parser can parse both without an issue.

EDIT: I added another scenario for a valid query if the negated term is only a single expression.

@paustint
Copy link
Collaborator

@ghingis - Thanks for bringing this up. NOT can be a tricky one, I will take a look.

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

No branches or pull requests

2 participants