Skip to content

No support for ANY and ALL use in WHERE #936

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

Closed
SeanTroyUWO opened this issue Jul 25, 2023 · 4 comments · Fixed by #963
Closed

No support for ANY and ALL use in WHERE #936

SeanTroyUWO opened this issue Jul 25, 2023 · 4 comments · Fixed by #963

Comments

@SeanTroyUWO
Copy link
Contributor

Seems like the parser only supports the use of ANY and ALL in SELECT, not WHERE.
This form seems to work:

SELECT ALL column_name(s)
FROM table_name
WHERE condition;

There's a test for it in tests/sqlparser_common.rs line: 1539
This does not supported:

SELECT column_name(s)
FROM table_name
WHERE column_name operator ALL
  (SELECT column_name
  FROM table_name
  WHERE condition); 

I'm not sure why this is the case. Please let me know if this is intentional. If not I can create a PR.

@SeanTroyUWO
Copy link
Contributor Author

The defining factor might actually be the use of a subquery after ALL of ANY.

@SeanTroyUWO
Copy link
Contributor Author

I think I have a good handle on the issue, can I submit a PR that adds or changes elements to enum Expr? This may be a breaking change.

@alamb
Copy link
Contributor

alamb commented Aug 7, 2023

Hi @SeanTroyUWO -- a PR would be most helpful

I am not totally sure what ALL and ANY mean in SQL, but here is one for adding something similar with UNION ALL: #915

@SeanTroyUWO
Copy link
Contributor Author

Hi @SeanTroyUWO -- a PR would be most helpful

I am not totally sure what ALL and ANY mean in SQL, but here is one for adding something similar with UNION ALL: #915

Okay finally getting around to this. The issue is I might break code that depends on the current implementation of ALL and ANY. Is that okay?

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 a pull request may close this issue.

2 participants