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

Support ANY/ALL for MVA in select list #2788

Open
1 of 6 tasks
sanikolaev opened this issue Nov 26, 2024 · 0 comments
Open
1 of 6 tasks

Support ANY/ALL for MVA in select list #2788

sanikolaev opened this issue Nov 26, 2024 · 0 comments
Assignees

Comments

@sanikolaev
Copy link
Collaborator

Proposal:

The any/all() function in MVA does not work when used in the select list, making it unusable for custom ranking. (related discussion on Slack.)

MRE:

mysql> drop table if exists t; create table t(m multi, f text); insert into t values(1, 'a', (1,2)),(2, 'a', ()); select * from t; select * from t where any(m) in (1); select any(m) in (1) from t;
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
create table t(m multi, f text)
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
insert into t values(1, 'a', (1,2)),(2, 'a', ())
--------------

Query OK, 2 rows affected (0.00 sec)

--------------
select * from t
--------------

+------+------+------+
| id   | f    | m    |
+------+------+------+
|    1 | a    | 1,2  |
|    2 | a    |      |
+------+------+------+
2 rows in set (0.00 sec)
--- 2 out of 2 results in 0ms ---

--------------
select * from t where any(m) in (1)
--------------

+------+------+------+
| id   | f    | m    |
+------+------+------+
|    1 | a    | 1,2  |
+------+------+------+
1 row in set (0.00 sec)
--- 1 out of 1 results in 0ms ---

--------------
select any(m) in (1) from t
--------------

ERROR 1064 (42000): P01: syntax error, unexpected ')' near ') in (1) from t'

Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

  • Implementation completed
  • Tests developed
  • Documentation updated
  • Documentation reviewed
  • Changelog updated
  • OpenAPI YAML updated and issue created to rebuild clients
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