Files
email-tracker/external/duckdb/test/fuzzer/pedro/blob_wrong_optimization.test
2025-10-24 19:21:19 -05:00

55 lines
1.2 KiB
SQL

# name: test/fuzzer/pedro/blob_wrong_optimization.test
# description: Blob wrong optimization
# group: [pedro]
statement ok
PRAGMA enable_verification;
statement ok
CREATE TABLE t0 (c0 INT);
statement ok
CREATE VIEW t1(c1, c0) AS (SELECT 1, max(c0) FROM t0);
query I
SELECT 1 FROM t1;
----
1
statement error
SELECT 1 FROM t1 WHERE '\x96'::BLOB IN (1);
----
<REGEX>:Conversion Error.*Unimplemented type for cast.*
statement error
SELECT 1 FROM t1 WHERE NOT ('\x96'::BLOB IN (1));
----
<REGEX>:Conversion Error.*Unimplemented type for cast.*
statement error
SELECT 1 FROM t1 WHERE ('\x96'::BLOB IN (1)) IS NULL;
----
<REGEX>:Conversion Error.*Unimplemented type for cast.*
statement ok
CREATE OR REPLACE VIEW t1(c0) AS (SELECT (SELECT 1 WHERE FALSE));
query I
SELECT 1 FROM t1;
----
1
statement error
SELECT 1 FROM t1 WHERE decode('\xC0'::BLOB) IS NULL; --1 row, wrong?
----
<REGEX>:Conversion Error.*Failure in decode.*to UTF8 string.*
statement error
SELECT 1 FROM t1 WHERE NOT (decode('\xC0'::BLOB) IS NULL); --1 row
----
<REGEX>:Conversion Error.*Failure in decode.*to UTF8 string.*
statement error
SELECT 1 FROM t1 WHERE (decode('\xC0'::BLOB) IS NULL) IS NULL; --1 row, wrong?
----
<REGEX>:Conversion Error.*Failure in decode.*to UTF8 string.*