Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions tests/sqllogictests/suites/query/subquery.test
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,37 @@ FROM nullable_fixed_probe_a AS a;
1 0
NULL 0

statement ok
CREATE OR REPLACE TABLE nullable_cross_type_probe_a (integer_key BIGINT NULL);

statement ok
CREATE OR REPLACE TABLE nullable_cross_type_probe_b (decimal_key DECIMAL(20, 0) NULL);

statement ok
INSERT INTO nullable_cross_type_probe_a VALUES
(NULL), (NULL), (NULL), (2097735747), (2109914711);

statement ok
INSERT INTO nullable_cross_type_probe_b VALUES (0);

query I
SELECT COUNT(*)
FROM nullable_cross_type_probe_a AS a
WHERE EXISTS (
SELECT 1 FROM nullable_cross_type_probe_b AS b WHERE b.decimal_key = a.integer_key
);
----
0

query I
SELECT COUNT(*)
FROM nullable_cross_type_probe_a AS a
WHERE NOT EXISTS (
SELECT 1 FROM nullable_cross_type_probe_b AS b WHERE b.decimal_key = a.integer_key
);
----
5

statement ok
SET enable_experimental_new_join = 0;

Expand All @@ -104,6 +135,24 @@ FROM nullable_fixed_probe_a AS a;
1 0 0
NULL 0 0

query I
SELECT COUNT(*)
FROM nullable_cross_type_probe_a AS a
WHERE EXISTS (
SELECT 1 FROM nullable_cross_type_probe_b AS b WHERE b.decimal_key = a.integer_key
);
----
0

query I
SELECT COUNT(*)
FROM nullable_cross_type_probe_a AS a
WHERE NOT EXISTS (
SELECT 1 FROM nullable_cross_type_probe_b AS b WHERE b.decimal_key = a.integer_key
);
----
5

statement ok
SET enable_experimental_new_join = 1;

Expand Down
Loading