Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.38.0
Description
Currently, the following query yields 2 output rows:
WITH tb as (select array(SELECT * FROM (VALUES (TRUE), (NULL)) as x(a)) as a) SELECT TRUE = ANY (SELECT b FROM UNNEST(a) AS x1(b)) AS test FROM tb;
Result:
+------+
| TEST |
+------+
| |
| true |
+------+
2 rows selected
According to any's syntax, the result should be:
+------+
| TEST |
+------+
| true |
+------+
1 row selected
As a reference, DuckDB returns the correct value.
The following query returns the correct value though (note that it's not correlated):
SELECT TRUE = ANY (SELECT * FROM (VALUES (TRUE), (NULL)) as x(a)) AS test;
I'm currently working on a fix, but it seems that this order by/limit clause should also be applied to correlated queries.
Thoughts?
Attachments
Issue Links
- links to