Skip to content

PostgreSQL: Accept any operator before ANY, SOME and ALL - #3072

Open
LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/pg-quantified-any-operator
Open

LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/pg-quantified-any-operator

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

SELECT a OPERATOR(pg_catalog.=) ANY (ARRAY[1, 2]) failed with Expected one of [=, >, <, =>, =<, !=, ~, ~*, !~, !~*, ~~, ~~*, !~~, !~~*] as comparison operator. PostgreSQL takes any operator before ANY, SOME and ALL and only later checks that it returns a boolean (https://www.postgresql.org/docs/current/functions-comparisons.html).

This PR adds supports_arbitrary_operator_in_quantified_comparison lifts the allowlist for PostgreSQL and Generic. Since in ClickHouse, Spark and Databricks a + any(b) calls the any aggregate, which would then parse as a quantified comparison, the other dialects keep the allowlist.

Closes #1841

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.63%. Comparing base (3ac3cc3) to head (7646533).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3072      +/-   ##
==========================================
+ Coverage   83.60%   83.63%   +0.02%     
==========================================
  Files          42       42              
  Lines       35751    35761      +10     
  Branches    35751    35761      +10     
==========================================
+ Hits        29891    29908      +17     
+ Misses       2418     2412       -6     
+ Partials     3442     3441       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change bug Something isn't working PostgreSQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postgres does not limit which operators can be used with ANY and ALL

2 participants