Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
For example:
SELECT (SELECT 1 FROM (SELECT 1) WHERE 1 = 0)
Returns 0, but expected NULL.
With correlated queries result even more strange:
CREATE TABLE test (a INTEGER) INSERT INTO test VALUES (1), (2), (null) SELECT (SELECT 1 FROM test t WHERE a = test.a) FROM test
Returns 1, 1, 1 (expected 1, 1, NULL)
Related test test_correlated_subquery.test_ignore
From SQL standard:
Let SS be a <scalar subquery>. Case: a) If the cardinality of SS is greater than 1 (one), then an exception condition is raised: cardinality violation. b) If the cardinality of SS is 0 (zero), then the value of the <scalar subquery> is the null value. c) Otherwise, let C be the column of <query expression> simply contained in SS. The value of SS is the value of C in the unique row of the result of the <scalar subquery>.
Attachments
Issue Links
- is part of
-
IGNITE-12248 Apache Calcite based query execution engine
- Open
- links to