forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request duckdb#12189 from gitccl/issue_12181
Fix move constants optimization
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# name: test/optimizer/issue_12181.test | ||
# description: Test move constants optimization involving DISTINCT FROM comparison | ||
# group: [optimizer] | ||
|
||
statement ok | ||
CREATE TABLE t0(c0 INT) | ||
|
||
statement ok | ||
CREATE TABLE t1(c0 INT, c1 INT) | ||
|
||
statement ok | ||
INSERT INTO t1(c0, c1) VALUES (0, 1) | ||
|
||
query I | ||
SELECT NULL IS DISTINCT FROM (1 + t1.c1) FROM t1 NATURAL LEFT JOIN t0 | ||
---- | ||
true | ||
|
||
query II | ||
SELECT * FROM t0 NATURAL RIGHT JOIN t1 WHERE (CASE t0.c0 WHEN t0.c0 THEN 1 ELSE NULL END) IS DISTINCT FROM (1 + (CASE t1.c1 WHEN t1.c1 THEN 2 ELSE NULL END)) | ||
---- | ||
0 1 |