should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
# name: test/optimizer/misc/test_count_and_sum.test
# description: Arithmetic simplification test
# group: [misc]
statement ok
DROP VIEW IF EXISTS v0;
statement ok
CREATE TABLE t0 (c0 TEXT);
statement ok
CREATE TABLE t1 (c1 TEXT);
statement ok
CREATE VIEW v0 AS
SELECT t0.c0
FROM t1
LEFT JOIN t0 ON t1.c1 = t0.c0;
statement ok
INSERT INTO t1(c1) VALUES ('example_value');
query I nosort result_1
SELECT COUNT(*)
FROM v0
WHERE (CURRENT_TIMESTAMP, c0) != (CAST(NULL AS TEXT), '0');
----
query I nosort result_1
SELECT SUM(CASE WHEN (CURRENT_TIMESTAMP, c0) != (CAST(NULL AS TEXT), '0') THEN 1 ELSE 0 END)
FROM v0;
----