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,11 @@
# name: test/fuzzer/afl/alter_if_exists.test
# description: Test alter table if it does not exist
# group: [afl]
statement ok
ALTER TABLE IF EXISTS t0 ADD COLUMN c1 INT;
statement error
ALTER TABLE t0 ADD COLUMN c1 INT;
----
Catalog Error: Table with name t0 does not exist

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/afl/analyze_empty_table.test
# description: Test analyze of empty table
# group: [afl]
statement ok
PRAGMA disable_optimizer
statement ok
CREATE TABLE t0 (c0 int);
statement ok
ANALYZE t0;

View File

@@ -0,0 +1,7 @@
# name: test/fuzzer/afl/case_map_cast.test
# description: Test case with map
# group: [afl]
query I
SELECT TRUE WHERE CASE MAP { } WHEN 'abc' [ ('any_string' IN (NULL::VARCHAR)): ] THEN TRUE END ;
----

View File

@@ -0,0 +1,46 @@
# name: test/fuzzer/afl/decimal_string_roundtrip.test
# description: Decimal to string statement verification assertion error
# group: [afl]
statement ok
PRAGMA enable_verification
query I
SELECT .0
----
.0
query I
SELECT .123456
----
.123456
query I
SELECT .1234567890123
----
.1234567890123
query I
SELECT .123456789012345678901234567890
----
.123456789012345678901234567890
query I
SELECT .0::VARCHAR
----
.0
query I
SELECT .123456::VARCHAR
----
.123456
query I
SELECT .1234567890123::VARCHAR
----
.1234567890123
query I
SELECT .123456789012345678901234567890::VARCHAR
----
.123456789012345678901234567890

View File

@@ -0,0 +1,44 @@
# name: test/fuzzer/afl/generate_series_null.test
# description: Fuzzer: NULL in generate series
# group: [afl]
statement ok
PRAGMA enable_verification
query I
SELECT c0 FROM generate_series(NULL) t3(c0);
----
query I
SELECT c0 FROM generate_series(0, NULL) t3(c0);
----
query I
SELECT c0 FROM generate_series(0, 0, NULL) t3(c0);
----
query I
SELECT c0 FROM generate_series(NULL, NULL, NULL) t3(c0);
----
query I
SELECT c0 FROM range(NULL) t3(c0);
----
query I
SELECT c0 FROM range(1, NULL) t3(c0);
----
query I
SELECT c0 FROM range(1, 1, NULL) t3(c0);
----
query I
SELECT c0 FROM range(NULL, NULL, NULL) t3(c0);
----
query II
SELECT c0, c0 FROM generate_series(1) t3(c0);
----
0 0
1 1

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/afl/grouping_empty_table.test
# description: Grouping on empty table assertion error
# group: [afl]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c1 INT);
query I
SELECT GROUPING(c1) FROM t0 GROUP BY CUBE(c1) ORDER BY 1;
----
1

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/afl/invalid_foreign_key.test
# description: Foreign key without primary/unique key counterpart
# group: [afl]
statement ok
PRAGMA enable_verification
statement error
create table y(y int, foreign key (y) references y(y));
----
<REGEX>:.*Binder Error: Failed to create foreign key.*referenced table "y".*

View File

@@ -0,0 +1,27 @@
# name: test/fuzzer/afl/issue_7551.test
# description: Issue #7551 - Segmentation fault on SELECT
# group: [afl]
statement ok
PRAGMA enable_verification
# FIXME - internal exception is thrown
mode skip
statement ok
CREATE TABLE t0(c0 VARCHAR);
statement ok
CREATE TABLE t1(c0 DATE);
statement ok
INSERT INTO t1(c0) VALUES ((TIMESTAMP '1970-01-25 15:59:18'));
statement ok
INSERT INTO t0(c0) VALUES ((DATE '1969-12-20')), ((TIMESTAMP '1970-01-11 21:25:45')), (DEFAULT), (('1')), (('')), ((TIMESTAMP '1969-12-15 21:35:22'));
statement ok
CREATE VIEW v0(c0) AS SELECT t1.c0 FROM t1, t0;
statement ok
SELECT t0.rowid FROM t0, t1 LEFT JOIN v0 ON (1) WHERE t0.c0 >= v0.c0 AND t0.c0 <= v0.c0;

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/afl/issue_8185.test
# description: Issue #8185 - DuckDB binary crashed at duckdb::ExpressionIterator::EnumerateChildren
# group: [afl]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE v0 ( v1 INTEGER , v2 INTEGER) ;
query II
SELECT * FROM v0 WHERE v2 <= 2 AND v2 <= v1 AND v1 < v2 ORDER BY v1 DESC ;
----

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/afl/limit_out_of_range.test
# description: Limit values out of range
# group: [afl]
statement ok
PRAGMA enable_verification
statement error
SELECT 1 LIMIT 3493690519702624888078795276804013381392711238711408854154521934990547605008475834286773858253643735619391784938186674922945640543537290894084514784093972720748475288610394187481276081350259062592878908961890372712236217855377408.000000%;
----
<REGEX>:Out of Range Error.*Limit percent.*
statement error
SELECT 1 LIMIT 3493690519702624888078795276804013381392711238711408854154521934990547605008475834286773858253643735619391784938186674922945640543537290894084514784093972720748475288610394187481276081350259062592878908961890372712236217855377408.000000;
----
<REGEX>:Conversion Error.*DOUBLE.*is out of range for.*INT64.*
statement error
SELECT 1 LIMIT CAST('NaN' AS REAL)%;
----
<REGEX>:Out of Range Error.*Limit percent.*

View File

@@ -0,0 +1,9 @@
# name: test/fuzzer/afl/non_foldable_parameter.test
# description: Execute prepared statement with random function
# group: [afl]
statement ok
PREPARE p AS SELECT ?;
statement ok
EXECUTE p (random());

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/afl/random_join.test
# description: Join on random condition
# group: [afl]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1(c1 INT);
query II
SELECT * FROM (SELECT 1) JOIN t1 ON random();
----

View File

@@ -0,0 +1,23 @@
# name: test/fuzzer/afl/self_referential_alias.test
# description: Invalid column assertion error
# group: [afl]
statement ok
PRAGMA enable_verification
statement error
SELECT x x WHERE x = 0;
----
Binder Error
statement ok
CREATE TABLE integers (a INT);
statement ok
INSERT INTO integers VALUES (0), (1), (2);
statement error
SELECT a as b, d as c, c as d from integers;
----
Binder Error

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/afl/window_function_binder_error.test
# description: Invalid window function call
# group: [afl]
statement ok
PRAGMA enable_verification
query I
SELECT count(x) OVER () FROM (SELECT 1) x(x);
----
1
statement error
SELECT count(x) OVER () FROM (SELECT 1) x(x) GROUP BY ALL;
----
Binder Error: Cannot group on a window clause

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/afl/window_type_mismatch.test
# description: Window functions typing issue
# group: [afl]
statement ok
PRAGMA enable_verification
query II
SELECT rank() OVER (), lag(NULL) OVER ();
----
1 NULL
query II
SELECT rank() OVER (), lag(NULL) OVER (ORDER BY x) FROM (VALUES (1)) tbl(x);
----
1 NULL

View File

@@ -0,0 +1,20 @@
# name: test/fuzzer/duckfuzz/arg_minmax_by_decimal.test
# description: Coverage for narrow DECIMAL ordering argument
# group: [duckfuzz]
statement ok
create table all_types as
select * exclude(small_enum, medium_enum, large_enum)
from test_all_types()
limit 0;
statement ok
SELECT min_by(DISTINCT c23, c22)
FROM all_types AS t43(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42)
statement error
SELECT c6
FROM all_types AS t43(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42)
PIVOT (argmin(c23, c6) FOR (c6, c33) IN ((8899, 4068)))
----
Binder Error: Referenced column "c6" not found in FROM clause

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/duckfuzz/array_const_columndatacopy.test
# group: [duckfuzz]
# Fuzzyduck issue #2392
# Caused by not copying over enough child vector data when adding a const array vector to a column data collection
statement ok
CREATE TABLE uuids(uuid UUID);
statement ok
INSERT INTO uuids VALUES('00000000-0000-0000-0000-000000000000');
statement ok
INSERT INTO uuids VALUES('ffffffff-ffff-ffff-ffff-ffffffffffff');
query I
SELECT TRY_CAST(uuid AS STRUCT(b VARCHAR[3])) FROM uuids;
----
NULL
NULL

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/duckfuzz/array_const_null_cast.test
# group: [duckfuzz]
# Internal Issue #1420
# Caused by not flattening constant null array vectors properly
statement ok
create table tbl(c8 UTINYINT);
statement ok
INSERT INTO tbl VALUES (0), (255), (NULL);
query I
SELECT CAST(TRY_CAST(c8 AS ENUM('DUCK_DUCK_ENUM', 'GOOSE')) AS VARCHAR[3]) FROM tbl;
----
NULL
NULL
NULL

View File

@@ -0,0 +1,22 @@
# name: test/fuzzer/duckfuzz/array_distance.test
# description: Repeat row with NULL argument
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
SELECT array_distance('asdf', [42]::INTEGER[1]);
----
array_distance: Arguments must be arrays of FLOAT or DOUBLE
# original issue: https://github.com/duckdb/duckdb-fuzzer/issues/2693
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement error
SELECT array_distance('db6d3411-3fe9-4668-bf60-06d94108c0f7', c44) FROM all_types AS t51(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44, c45, c46, c47, c48, c49, c50, c51)
----
array_distance: Arguments must be arrays of FLOAT or DOUBLE

View File

@@ -0,0 +1,40 @@
# name: test/fuzzer/duckfuzz/array_group_by_sample.test
# description: Test allocating enough dummy list_entry_t's during tuple format serialization.
# group: [duckfuzz]
require notmusl
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE array_tbl(c50 INTEGER[2][]);
statement ok
INSERT INTO array_tbl VALUES('[[1, 2], [1, 2]]');
statement ok
INSERT INTO array_tbl VALUES('[[3, 4], [3, 4]]');
query I rowsort
SELECT c50 FROM array_tbl GROUP BY ALL USING SAMPLE 3;
----
[[1, 2], [1, 2]]
[[3, 4], [3, 4]]
# Three-level nested ARRAY.
statement ok
CREATE TABLE array_tbl_three_level(c50 INTEGER[2][2][]);
statement ok
INSERT INTO array_tbl_three_level VALUES('[[[42, 43], [44, 45]], [[46, 47], [48, 49]]]');
statement ok
INSERT INTO array_tbl_three_level VALUES('[[[12, 13], [14, 15]], [[16, 17], [18, 19]]]');
query I rowsort
SELECT c50 FROM array_tbl_three_level GROUP BY ALL USING SAMPLE 3 ORDER BY ALL;
----
[[[12, 13], [14, 15]], [[16, 17], [18, 19]]]
[[[42, 43], [44, 45]], [[46, 47], [48, 49]]]

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/duckfuzz/array_hash.test
# group: [duckfuzz]
statement ok
PRAGMA threads = 1
statement ok
PRAGMA enable_verification
# Duckfuzz Issue #1434
# Caused by not calculating the correct number of child elements when hashing a constant array vector.
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
query I rowsort
SELECT subq_0.c2 AS c4 FROM (SELECT ref_1.fixed_nested_int_array AS c2 FROM main.all_types AS ref_0 LEFT JOIN main.all_types AS ref_1 ON ((ref_0."varchar" !~~* ref_1."varchar"))) AS subq_0 RIGHT JOIN main.all_types AS ref_2 ON ((subq_0.c2 = ref_2.fixed_nested_int_array))
----
NULL
[[4, 5, 6], [NULL, 2, 3], [4, 5, 6]]
[[4, 5, 6], [NULL, 2, 3], [4, 5, 6]]
[[NULL, 2, 3], NULL, [NULL, 2, 3]]

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/duckfuzz/array_list_gather_cast.test
# description: duckdb-fuzzer #3237 - Vector was not reset from cache before gathering
# group: [duckfuzz]
statement ok
create table my_table as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
# should error, not crash
statement error
FROM main.my_table ref_0
INNER JOIN
main.my_table AS ref_1
ON (
SELECT
ref_1.struct_of_arrays AS c6
FROM main.my_table AS ref_2
WHERE
EXISTS(SELECT ref_2.fixed_nested_varchar_array WHERE ref_1."union")
) and ref_1."varchar" ~~ ref_1."varchar";
----
Conversion Error

View File

@@ -0,0 +1,10 @@
# name: test/fuzzer/duckfuzz/array_serialization_flattening.test
# group: [duckfuzz]
# Internal Issue #1409
# Caused by accidentally flattening during serialization/verification of array vectors
statement ok
CREATE TABLE test(c2 BOOL, c48 STRUCT(a INTEGER[3], b VARCHAR[3]));;
statement ok
INSERT INTO test VALUES(false, '{''a'': [NULL, 2, 3], ''b'': [a, NULL, c]}');

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/duckfuzz/array_slice_nullness.test
# description: array_slice did not early out on NULL
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
# simplified
query I
SELECT array_reverse(NULL::INTEGER[])
----
NULL
# https://github.com/duckdb/duckdb-fuzzer/issues/2692
statement ok
SELECT NULL LIMIT array_reverse(TRY_CAST(5722 AS TIMESTAMP WITH TIME ZONE[]))

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/duckfuzz/array_slice_underflow.test
# description: Array slice underflow
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
query I
SELECT ([1, 2, 3])[0:-9223372036854775808];
----
[]
query I
SELECT ([1, 2, 3])[-9223372036854775808:0];
----
[]

View File

@@ -0,0 +1,52 @@
# name: test/fuzzer/duckfuzz/array_slice_vector_type.test
# description: Fuzzyduck issue #1228
# group: [duckfuzz]
# Verify that the array_pop_front() properly removes one element
query II nosort expected
SELECT
length(original) == length(altered) + 1
from (
select
x as original,
array_pop_front(x) as altered
FROM test_vector_types('x') AS t1(x)
);
----
query II nosort expected
select case
when x IS NULL
then
NULL
else
true
end
from test_vector_types('x') t1(x);
----
statement ok
create table tbl (i integer[]);
statement ok
insert into tbl VALUES
(NULL),
([5,3,2,1]),
(NULL),
(NULL),
([1]),
([NULL]),
([345,2,31,23,123,1,2,1,1,1])
# Check that NULLs are handled correctly
query I
select array_pop_front(i) from tbl;
----
NULL
[3, 2, 1]
NULL
NULL
[]
[]
[2, 31, 23, 123, 1, 2, 1, 1, 1]

View File

@@ -0,0 +1,9 @@
# name: test/fuzzer/duckfuzz/arrow_scan_subquery_nullptr.test
# description: Fuzzyduck issue #1212
# group: [duckfuzz]
statement error
SELECT * FROM (SELECT * FROM arrow_scan(NULL, NULL, NULL));
Binder Error: arrow_scan: pointers cannot be null
----
Parser Error: syntax error at or near "Binder"

View File

@@ -0,0 +1,28 @@
# name: test/fuzzer/duckfuzz/bind_limit_num.test
# description: Fuzzyduck issue #1581
# group: [duckfuzz]
require tpch
statement ok
call dbgen(sf=0.001);
statement ok
SELECT subq_2.c0 AS c2
FROM main.orders AS ref_0,
(
SELECT 1 AS c0
FROM main.customer AS ref_1 RIGHT JOIN
main.partsupp AS ref_2 ON
(ref_2.ps_availqty IS NULL),
(
SELECT 20 AS c5,
FROM main.orders AS ref_4,
(
SELECT 97 AS c0,
ref_0.o_orderdate AS c1
FROM main.orders LIMIT 93
) AS subq_0
WHERE (ref_1.c_mktsegment ~~ ref_0.o_clerk)
) AS subq_1
) AS subq_2;

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/duckfuzz/bitstring_agg_minmax.test
# description: Coverage for narrow DECIMAL ordering argument
# group: [duckfuzz]
statement error
select bitstring_agg(4741, 1706, -128);
----
Invalid explicit bitstring range
statement error
select bitstring_agg(4741, 1706, 1706);
----
Value 4741 is outside of provided min and max range (1706 <-> 1706)
statement ok
select bitstring_agg(1706, 1706, 1706);
statement error
select bitstring_agg(4741::hugeint, 1706::hugeint, -128::hugeint);
----
Invalid explicit bitstring range
statement error
select bitstring_agg(4741::uhugeint, 1706::uhugeint, 40::uhugeint);
----
Invalid explicit bitstring range

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/duckfuzz/bitstring_agg_uhugeint.test
# description: Coverage for narrow DECIMAL ordering argument
# group: [duckfuzz]
statement ok
create table all_types as select hugeint, uhugeint from test_all_types();
statement error
SELECT bitstring_agg(uhugeint) FROM all_types;
----
Out of Range Error
statement error
SELECT bitstring_agg(hugeint) FROM all_types;
----
Out of Range Error

View File

@@ -0,0 +1,30 @@
# name: test/fuzzer/duckfuzz/bitstring_agg_unfoldable.test
# description: Bitstring agg with unfoldable parameters
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
SELECT bitstring_agg(i, i, 42) FROM range(10) t(i);
----
requires a constant min and max argument
statement error
SELECT bitstring_agg(i, 42, i) FROM range(10) t(i);
----
requires a constant min and max argument
# constant but not foldable
statement error
SELECT bitstring_agg(i, 0, (100 + random())::BIGINT) FROM range(10) t(i);
----
requires a constant min and max argument
statement ok
PRAGMA disable_verification
statement error
SELECT bitstring_agg(i, 0, 3) FROM range(10) t(i);
----
outside of provided min and max range

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/duckfuzz/complex_join_cardinality_assert.test
# description: Complex join that triggered an issue in debug code in the cardinality estimator
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
create table integers(i int);
query I
SELECT NULL FROM integers AS t1 RIGHT JOIN integers AS t2 ON (NULL) WHERE EXISTS(SELECT NULL FROM integers AS t3 INNER JOIN integers ON ((t3.i + t1.i)) , (SELECT t2.i AS c0))
----

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/duckfuzz/compressed_materialization_hugeint.test
# description: Compressed Materialization optimizer shouldn't over-/underflow (u)hugeint
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement ok
SELECT DISTINCT TRY_CAST(COLUMNS(*) AS HUGEINT) FROM all_types AS t51(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44, c45, c46, c47, c48, c49, c50) ORDER BY c14 DESC NULLS FIRST
statement ok
SELECT DISTINCT TRY_CAST(COLUMNS(*) AS UHUGEINT) FROM all_types AS t51(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44, c45, c46, c47, c48, c49, c50) ORDER BY c14 DESC NULLS FIRST

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/duckfuzz/compressed_materialization_json.test
# description: Compressed Materialization optimizer should respect extension types
# group: [duckfuzz]
require json
statement ok
PRAGMA enable_verification
query I
select distinct json_array();
----
[]

View File

@@ -0,0 +1,44 @@
# name: test/fuzzer/duckfuzz/correlated_subqueries.test
# description: Type mismatch in map concat
# group: [duckfuzz]
require tpch
require json
statement ok
CREATE TABLE mytable(i INT)
## https://github.com/duckdb/duckdb-fuzzer/issues/3244
statement ok
SELECT
(
SELECT
(
SELECT (SELECT ref_2.i)
FROM mytable AS ref_2
)
WHERE
(
SELECT subq_0.i AS c1
)
)
FROM mytable AS subq_0
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types() limit 0;
# https://github.com/duckdb/duckdb-fuzzer/issues/3124
statement ok
SELECT
NULL
FROM main.all_types AS ref_0
WHERE
EXISTS(
SELECT EXISTS(
SELECT NULL
FROM main.all_types AS ref_3
WHERE EXISTS(SELECT NULL WHERE ref_3."varchar")
)
FROM (SELECT NULL WHERE EXISTS(SELECT NULL WHERE ref_0."varchar")))

View File

@@ -0,0 +1,23 @@
# name: test/fuzzer/duckfuzz/create_sort_key_strings.test
# description: create_sort_key with string boundaries
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t2(c38 STRUCT(a INTEGER, b VARCHAR));
statement ok
INSERT INTO t2 VALUES({'a': NULL, 'b': NULL});
statement ok
INSERT INTO t2 VALUES({'a': 42, 'b': '🦆🦆🦆🦆🦆🦆'});
statement ok
INSERT INTO t2 VALUES(NULL);
query I
SELECT any_value(NULL ORDER BY c38 ASC) FROM t2
----
NULL

View File

@@ -0,0 +1,27 @@
# name: test/fuzzer/duckfuzz/duck_fuzz_column_binding_tests.test
# description: test why column bindings fail.
# group: [duckfuzz]
require tpch
require icu
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types() limit 0;
# https://github.com/duckdb/duckdb-fuzzer/issues/1357
# simplified query
statement ok
SELECT ref_8.uint AS c0,
Argmin(Cast(ref_8."timestamp" AS TIMESTAMP), Cast(ref_10."timestamp" AS TIMESTAMP)) OVER (partition BY ref_10."nested_int_array", ref_10."timestamp" ORDER BY ref_8.hugeint) AS c1
FROM main.all_types AS ref_8
INNER JOIN main.all_types AS ref_9
INNER JOIN main.all_types AS ref_10
ON ( ref_10.dec38_10 IS NOT NULL)
OR EXISTS
( SELECT ref_9."float" FROM main.all_types)
ON ((ref_9."smallint" = ref_8."smallint"))
statement ok
SELECT subq_0.c6 AS c1, subq_0.c14 AS c2, subq_0.c7 AS c4, subq_0.c4 AS c5 FROM (SELECT (SELECT date FROM main.all_types LIMIT 1 OFFSET 6) AS c3, ref_2."time" AS c4, (SELECT uuid FROM main.all_types LIMIT 1 OFFSET 1) AS c5, ref_3.array_of_structs AS c6, CASE WHEN (((ref_0."varchar" !~~* ref_1."varchar") OR (ref_5."varchar" ~~~ ref_6."varchar"))) THEN (ref_2."bigint") ELSE ref_2."bigint" END AS c7, rtrim(CAST(CASE WHEN ((((ref_8."varchar" ~~~ ref_2."varchar") AND (ref_2."varchar" ~~~ ref_0."varchar")) OR (1 AND (ref_7."varchar" ~~ ref_2."varchar")))) THEN (ref_8."varchar") ELSE ref_8."varchar" END AS VARCHAR), CAST(ref_2."varchar" AS VARCHAR)) AS c9, ref_8.ubigint AS c14 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 INNER JOIN main.all_types AS ref_2 ON ((ref_1.int_array = ref_2.int_array)) ON (((ref_2."varchar" !~~ ref_1."varchar") OR (ref_1.blob IS NOT NULL))) INNER JOIN main.all_types AS ref_3 INNER JOIN main.all_types AS ref_4 RIGHT JOIN main.all_types AS ref_5 ON ((ref_4.dec_18_6 = ref_5.dec_18_6)) ON (ref_5."varchar") LEFT JOIN main.all_types AS ref_6 RIGHT JOIN main.all_types AS ref_7 INNER JOIN main.all_types AS ref_8 ON ((ref_7.timestamp_array = ref_8.timestamp_array)) ON (1) ON (NULL) ON ((ref_0.dec_18_6 = ref_3.dec_18_6)) WHERE (ref_5."varchar" ^@ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 6)) LIMIT 96) AS subq_0 WHERE subq_0.c9;

View File

@@ -0,0 +1,28 @@
# name: test/fuzzer/duckfuzz/empty_result_pullup_delim_joins.test
# description: test why column bindings fail.
# group: [duckfuzz]
require tpch
statement ok
call dbgen(sf=0.1);
statement ok
SELECT
NULL
FROM
main.partsupp AS ref_1
INNER JOIN main.region ON (NULL)
INNER JOIN main.customer AS ref_3 ON
(EXISTS(SELECT NULL FROM (SELECT ref_3.c_acctbal AS c0)))
INNER JOIN
(SELECT
ref_9.s_phone AS c0,
ref_8.r_regionkey AS c1,
ref_9.s_phone AS c2
FROM main.region AS ref_8
RIGHT JOIN
main.supplier AS ref_9 ON ((1 AND (ref_9.s_comment ~~ ref_9.s_address) AND 0 AND (ref_9.s_name !~~ ref_9.s_name)))
LEFT JOIN main.customer AS ref_10 ON ((ref_10.c_address ~~* ref_10.c_comment))
WHERE (ref_9.s_phone IS NOT NULL) LIMIT 53) AS subq_2
ON ((CASE WHEN (1) THEN (subq_2.c2) ELSE subq_2.c2 END !~~ ref_1.ps_comment))

View File

@@ -0,0 +1,7 @@
# name: test/fuzzer/duckfuzz/enum_const_cast.test
# group: [duckfuzz]
query I
SELECT CAST(TRY_CAST((ceil(2918) AND shobj_description(5, (NOT 6203))) AS ENUM('enum_0', 'enum_1', 'enum_2', 'enum_3', 'enum_4', 'enum_5', 'enum_6', 'enum_7', 'enum_8', 'enum_9', 'enum_10', 'enum_11', 'enum_12', 'enum_13', 'enum_14', 'enum_15', 'enum_16', 'enum_17', 'enum_18', 'enum_19', 'enum_20', 'enum_21', 'enum_22', 'enum_23', 'enum_24', 'enum_25', 'enum_26', 'enum_27', 'enum_28', 'enum_29', 'enum_30', 'enum_31', 'enum_32', 'enum_33', 'enum_34', 'enum_35', 'enum_36', 'enum_37', 'enum_38', 'enum_39', 'enum_40', 'enum_41', 'enum_42', 'enum_43', 'enum_44', 'enum_45', 'enum_46', 'enum_47', 'enum_48', 'enum_49', 'enum_50', 'enum_51', 'enum_52', 'enum_53', 'enum_54', 'enum_55', 'enum_56', 'enum_57', 'enum_58', 'enum_59', 'enum_60', 'enum_61', 'enum_62', 'enum_63', 'enum_64', 'enum_65', 'enum_66', 'enum_67', 'enum_68', 'enum_69', 'enum_70', 'enum_71', 'enum_72', 'enum_73', 'enum_74', 'enum_75', 'enum_76', 'enum_77', 'enum_78', 'enum_79', 'enum_80', 'enum_81', 'enum_82', 'enum_83', 'enum_84', 'enum_85', 'enum_86', 'enum_87', 'enum_88', 'enum_89', 'enum_90', 'enum_91', 'enum_92', 'enum_93', 'enum_94', 'enum_95', 'enum_96', 'enum_97', 'enum_98', 'enum_99', 'enum_100', 'enum_101', 'enum_102', 'enum_103', 'enum_104', 'enum_105', 'enum_106', 'enum_107', 'enum_108', 'enum_109', 'enum_110', 'enum_111', 'enum_112', 'enum_113', 'enum_114', 'enum_115', 'enum_116', 'enum_117', 'enum_118', 'enum_119', 'enum_120', 'enum_121', 'enum_122', 'enum_123', 'enum_124', 'enum_125', 'enum_126', 'enum_127', 'enum_128', 'enum_129', 'enum_130', 'enum_131', 'enum_132', 'enum_133', 'enum_134', 'enum_135', 'enum_136', 'enum_137', 'enum_138', 'enum_139', 'enum_140', 'enum_141', 'enum_142', 'enum_143', 'enum_144', 'enum_145', 'enum_146', 'enum_147', 'enum_148', 'enum_149', 'enum_150', 'enum_151', 'enum_152', 'enum_153', 'enum_154', 'enum_155', 'enum_156', 'enum_157', 'enum_158', 'enum_159', 'enum_160', 'enum_161', 'enum_162', 'enum_163', 'enum_164', 'enum_165', 'enum_166', 'enum_167', 'enum_168', 'enum_169', 'enum_170', 'enum_171', 'enum_172', 'enum_173', 'enum_174', 'enum_175', 'enum_176', 'enum_177', 'enum_178', 'enum_179', 'enum_180', 'enum_181', 'enum_182', 'enum_183', 'enum_184', 'enum_185', 'enum_186', 'enum_187', 'enum_188', 'enum_189', 'enum_190', 'enum_191', 'enum_192', 'enum_193', 'enum_194', 'enum_195', 'enum_196', 'enum_197', 'enum_198', 'enum_199', 'enum_200', 'enum_201', 'enum_202', 'enum_203', 'enum_204', 'enum_205', 'enum_206', 'enum_207', 'enum_208', 'enum_209', 'enum_210', 'enum_211', 'enum_212', 'enum_213', 'enum_214', 'enum_215', 'enum_216', 'enum_217', 'enum_218', 'enum_219', 'enum_220', 'enum_221', 'enum_222', 'enum_223', 'enum_224', 'enum_225', 'enum_226', 'enum_227', 'enum_228', 'enum_229', 'enum_230', 'enum_231', 'enum_232', 'enum_233', 'enum_234', 'enum_235', 'enum_236', 'enum_237', 'enum_238', 'enum_239', 'enum_240', 'enum_241', 'enum_242', 'enum_243', 'enum_244', 'enum_245', 'enum_246', 'enum_247', 'enum_248', 'enum_249', 'enum_250', 'enum_251', 'enum_252', 'enum_253', 'enum_254', 'enum_255', 'enum_256', 'enum_257', 'enum_258', 'enum_259', 'enum_260', 'enum_261', 'enum_262', 'enum_263', 'enum_264', 'enum_265', 'enum_266', 'enum_267', 'enum_268', 'enum_269', 'enum_270', 'enum_271', 'enum_272', 'enum_273', 'enum_274', 'enum_275', 'enum_276', 'enum_277', 'enum_278', 'enum_279', 'enum_280', 'enum_281', 'enum_282', 'enum_283', 'enum_284', 'enum_285', 'enum_286', 'enum_287', 'enum_288', 'enum_289', 'enum_290', 'enum_291', 'enum_292', 'enum_293', 'enum_294', 'enum_295', 'enum_296', 'enum_297', 'enum_298', 'enum_299')) AS ENUM('enum_0', 'enum_69999'))
----
NULL

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/duckfuzz/filter_combiner_assert.test
# description: Test filter combiner assert
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE partsupp(ps_partkey INTEGER, ps_suppkey INTEGER, ps_availqty INTEGER, ps_supplycost DECIMAL(15,2), ps_comment VARCHAR);
statement ok
SELECT NULL FROM partsupp AS t6(c1, c2, c3, c4, c5) WHERE (c4 = COLUMNS(* REPLACE (3947 AS c3)))

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/duckfuzz/fuzzer_issue_2698.test
# description: Test fuzzyduck
# group: [duckfuzz]
require json
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types() limit 0;
query I
SELECT (TRY_CAST(5572 AS INTEGER[3][3]) BETWEEN json(c48) AND NULL) FROM all_types AS t51(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44, c45, c46, c47, c48, c49, c50);
----

View File

@@ -0,0 +1,8 @@
# name: test/fuzzer/duckfuzz/fuzzer_issue_2980.test
# description: NULL in query Table function not allows
# group: [duckfuzz]
statement error
SELECT DISTINCT NULL FROM query_table(NULL, NULL) AS t6(c1, c2, c3, c4, c5) , region AS t10(c7, c8, c9) HAVING TRY_CAST(c3 AS STRUCT(a INTEGER, b VARCHAR)[3]) QUALIFY (c3 BETWEEN c8 AND (c4 BETWEEN c4 AND c5));
----
<REGEX>:.*Cannot use NULL.*

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/duckfuzz/generate_null_timestamp.test
# description: Generate Series NULL timestamp
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
query I
SELECT NULL
FROM generate_series(CAST('294247-01-10 04:00:54.775806' AS TIMESTAMP), NULL, NULL) AS t3(c1, c2)
----

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/duckfuzz/group_by_all_positional_ref.test
# description: Mix GROUP BY ALL and positional references
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
create table integers(c1 int, c2 int);
statement ok
SELECT c1, #2 FROM integers GROUP BY ALL

View File

@@ -0,0 +1,9 @@
# name: test/fuzzer/duckfuzz/hash_constant.test
# description: Hashing constants should yield a constant vector (duckdb-fuzzer #290)
# group: [duckfuzz]
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement ok
SELECT hash(main.list_value(main.list_value(), main.list_value(42, 999, NULL, NULL, -42), NULL, main.list_value(), main.list_value(42, 999, NULL, NULL, -42))) FROM all_types;

View File

@@ -0,0 +1,8 @@
# name: test/fuzzer/duckfuzz/hugeint_negate_underflow.test
# description: Negating of hugeint min leads to signed integer overflow
# group: [duckfuzz]
statement error
select -(-170141183460469231731687303715884105728)::HUGEINT;
----
Overflow

View File

@@ -0,0 +1,41 @@
# name: test/fuzzer/duckfuzz/invalid_make_time.test
# description: Invalid make time
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
SELECT make_time(64, 64, 157);
----
Time out of range
statement error
SELECT make_time(-1, 64, 157);
----
Time out of range
statement error
SELECT make_time(1, 64, 157);
----
Time out of range
statement error
SELECT make_time(1, -1, 157);
----
Time out of range
statement error
SELECT make_time(1, 1, -1);
----
Time out of range
statement error
SELECT make_time(1, 1, 157);
----
Time out of range
statement error
SELECT make_time(1, 1, 9999999);
----
Time out of range

View File

@@ -0,0 +1,18 @@
# name: test/fuzzer/duckfuzz/json_execute_serialized_null.test
# description: Json execute serialize cannot execute on NULL argument
# group: [duckfuzz]
require tpch
require json
statement ok
PRAGMA enable_verification
statement ok
call dbgen(sf=0.01);
statement error
SELECT lead(c9, c18) OVER (ORDER BY 2399 DESC NULLS FIRST ROWS BETWEEN c2 PRECEDING AND #10 FOLLOWING) FROM (SELECT c4 FROM json_execute_serialized_sql(NULL) AS t5(c1, c2, c3, c4)) AS t6 , (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (VALUES (3579, 426, main.list_value(), 5272, CAST('290309-12-22 (BC) 00:00:00' AS TIMESTAMP_S), '356f1b18-7a3d-417e-97eb-710eae92f600', NULL, 634), (CAST('290309-12-22 (BC) 00:00:00' AS TIMESTAMP), NULL, 1138, NULL, NULL, 8922, 1726, 5539), (main.list_value(42.0, CAST('nan' AS DOUBLE), 1e1000, -1e1000, NULL, -42.0), 'enum_69999', 'dcf24776-2f79-4878-a175-8daabf453cd0', '9d4c7f67-bdcb-46c5-bd44-1d04be3b94ab', NULL, 9021, 1124, 6294)) AS valueslist) AS valueslist) AS valueslist) AS valueslist) AS valueslist) AS valueslist) AS valueslist) AS valueslist) FULL JOIN lineitem AS t23(c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22) ON (c8);
----
Binder Error

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/duckfuzz/json_extract_null.test
# description: JSON Extract NULL
# group: [duckfuzz]
require json
statement ok
PRAGMA enable_verification
query I
SELECT json_extract('hello world', CAST(NULL AS json)) AS c1
----
NULL

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/duckfuzz/json_extract_string_null.test
# description: NULL input to json_extract_string - found by fuzzer
# group: [duckfuzz]
require json
statement ok
pragma enable_verification
statement ok
create table integers(i int);
statement ok
insert into integers values (1);
query I
SELECT json_extract_string(false, COALESCE(CASE WHEN (i) THEN (CAST(NULL AS "json")) ELSE NULL END, NULL)) FROM integers;
----
NULL

View File

@@ -0,0 +1,33 @@
# name: test/fuzzer/duckfuzz/json_functions_null_params.test
# description: JSON functions with parameters that evaluate to NULL (duckdb-fuzzer #294 and #319)
# group: [duckfuzz]
require json
statement ok
PRAGMA enable_verification
query I
SELECT from_json('{"duck": 42}', NULL::JSON)
----
NULL
query I
SELECT json_extract('{"duck": 42}', NULL::VARCHAR[])
----
NULL
query I
SELECT json_keys('{"duck": 42}', NULL::VARCHAR[])
----
NULL
query I
SELECT json_valid(NULL)
----
NULL
query I
SELECT json_extract('{"duck": 42}', NULL::VARCHAR)
----
NULL

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/duckfuzz/julian_overflow.test
# description: Array slice underflow
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
SELECT julian(c1)
FROM test_vector_types(CAST(NULL AS DATE)) AS test_vector_types(c1);
statement ok
create table all_types as
select * exclude(small_enum, medium_enum, large_enum)
from test_all_types();
statement ok
SELECT julian(CAST(ref_0.date AS DATE)) AS c1
FROM main.all_types AS ref_0

View File

@@ -0,0 +1,17 @@
# name: test/fuzzer/duckfuzz/late_materialization_filter.test
# description: NULL input to json_extract_string - found by fuzzer
# group: [duckfuzz]
statement ok
create table tbl(z int, i bool, j bool, k uhugeint);
statement ok
insert into tbl (i, j, k) values (true, 'true', 3), (NULL, NULL, NULL), (false, 'false', 1);
query I
select k
from tbl
where i and j
limit 30;
----
3

View File

@@ -0,0 +1,12 @@
# name: test/fuzzer/duckfuzz/limit_offset_macro_subquery.test
# description: Array slice underflow
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
# test macro with subquery in limit/offset
query I
SELECT 42 OFFSET format_type(NULL, 2515);
----
42

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/duckfuzz/limit_percent_subquery.test
# description: Limit percent subquery
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
create table tbl(i INT);
query I
FROM tbl LIMIT (EXISTS(SELECT 42))%
----
statement ok
INSERT INTO tbl VALUES (42);
query I
FROM tbl LIMIT (EXISTS(SELECT 42))%
----

View File

@@ -0,0 +1,34 @@
# name: test/fuzzer/duckfuzz/list_try_cast.test
# description: list try cast
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
create table integers(i INT[]);
statement ok
INSERT INTO integers VALUES ([42, 999, NULL, NULL, -42]);
query I
SELECT TRY_CAST(i AS TIMESTAMP WITH TIME ZONE[]) FROM integers;
----
[NULL, NULL, NULL, NULL, NULL]
statement ok
create table strings(v VARCHAR[]);
statement ok
INSERT INTO strings VALUES (['42', NULL, '84', 'hello world', '100']);
query I
SELECT TRY_CAST(v AS INTEGER[]) FROM strings;
----
[42, NULL, 84, NULL, 100]
# Issue #10140 (used to crash)
statement error
SELECT DISTINCT OPERATOR ( / ) + ARRAY [ ] :: INTERVAL SECONDS [ ] [ ] :: SETOF NCHAR ARRAY :: FLOAT ;
----
No function matches the given name and argument types

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/duckfuzz/list_zip_no_args.test
# description: Test List Zip with no arguments.
# group: [duckfuzz]
# https://github.com/duckdb/duckdb-fuzzer/issues/1361
statement error
SELECT array_zip() AS c0;
----
Binder Error
statement error
SELECT list_zip()
----
Binder Error

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/duckfuzz/map_concat_type_mismatch.test
# description: Type mismatch in map concat
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
SELECT map_concat(42, 42);
----
only takes map arguments
statement error
SELECT map_concat(map { 'a': 42 }, 42);
----
only takes map arguments
query I
SELECT map_concat(map { 'a': 42 }, NULL);
----
{a=42}

View File

@@ -0,0 +1,60 @@
# name: test/fuzzer/duckfuzz/null_arguments.test
# description: Null arguments do not throw internal exceptions
# group: [duckfuzz]
require json
require tpch
require parquet
statement error
SELECT NULL FROM parquet_scan(NULL, "schema" := NULL);
----
<REGEX>:.*NULL.*
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement error
SELECT NULL FROM read_ndjson_auto(NULL, timestamp_format := 5469, "compression" := NULL)
----
<REGEX>:.*NULL.*
statement ok
COPY (VALUES (NULL), (NULL)) TO '__TEST_DIR__/test_null_args.parquet' (FORMAT PARQUET);
statement error
SELECT NULL FROM read_parquet('__TEST_DIR__/test_null_args.parquet', filename = NULL);
----
<REGEX>:.*Cannot use NULL.*
statement error
FROM read_ndjson(NULL, filename := NULL) AS t14(c11, c12, c13)
----
<REGEX>:.*NULL.*
statement ok
COPY (VALUES (NULL), (NULL)) TO '__TEST_DIR__/test_null_args.csv' (FORMAT CSV);
statement error
SELECT NULL FROM read_csv('__TEST_DIR__/test_null_args.csv', names=NULL);
----
<REGEX>:.*read_csv names cannot be NULL.*
statement ok
call dbgen(sf=0.01);
#https://github.com/duckdb/duckdb-fuzzer/issues/2703
statement ok
SELECT NULL FROM (
SELECT
hex(CAST(CAST(NULL AS BLOB) AS BLOB)) AS c7,
ref_0.r_comment AS c11
FROM main.region AS ref_0
) AS subq_0
WHERE (
(subq_0.c11 ~~ subq_0.c7)
);

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/duckfuzz/null_checkpoint.test
# description: NULL checkpoint
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
CALL checkpoint(NULL)
----
Database cannot be NULL

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/duckfuzz/ordagg_nargs.test
# description: Ordered Aggregates with > 1 argument
# group: [duckfuzz]
statement ok
create table all_types as
select * exclude(small_enum, medium_enum, large_enum)
from test_all_types()
limit 0;
statement ok
SELECT cume_dist() OVER (ROWS
BETWEEN UNBOUNDED PRECEDING
AND regr_sxx(6311, 8320
ORDER BY 1726 ASC NULLS FIRST,
10101,
(946 BETWEEN 2053 AND 182) DESC NULLS LAST)
FILTER (WHERE 118) PRECEDING
)

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/duckfuzz/order_by_positional_reference.test
# description: Mix GROUP BY ALL and positional references
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
create table integers(c1 int, c2 int);
statement error
SELECT c1, c2, NULL FROM integers ORDER BY #10
----
term out of range

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/duckfuzz/pivot_aggregate_mismatch.test
# description: Pivot with non-aggregate function
# group: [duckfuzz]
require icu;
statement ok
PRAGMA enable_verification
statement error
FROM (VALUES (42)) t(i) PIVOT (current_date() FOR (i) IN (41))
----
Binder Error: Pivot expression must contain exactly one aggregate

View File

@@ -0,0 +1,18 @@
# name: test/fuzzer/duckfuzz/qualify_column_reference.test
# description: Qualify column reference
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement ok
create table tbl(c1 int, c2 int);
statement error
SELECT c1 FROM tbl GROUP BY c1 QUALIFY cume_dist() OVER (ROWS BETWEEN c2 PRECEDING AND CURRENT ROW);
----
column "c2" must appear in the GROUP BY clause
query I
SELECT c1 FROM tbl GROUP BY c1 QUALIFY cume_dist() OVER (ROWS BETWEEN c1 PRECEDING AND CURRENT ROW);
----

View File

@@ -0,0 +1,18 @@
# name: test/fuzzer/duckfuzz/read_ndjson_non_varchar_input.test
# description: read_ndjson with non-varchar input
# group: [duckfuzz]
require json
statement ok
PRAGMA enable_verification
statement error
FROM read_ndjson([42])
----
No function matches
statement error
FROM read_csv_auto([42])
----
No function matches

View File

@@ -0,0 +1,33 @@
# name: test/fuzzer/duckfuzz/regex_syntax_2889.test
# description: Test REGEX syntax
# group: [duckfuzz]
query I
SELECT 42
----
42
query I
SELECT 42
----
<REGEX>:42
query I
SELECT 42
----
<REGEX>:.*
query I
SELECT 42
----
<!REGEX>:quack
statement error
SELECT
----
SELECT clause without selection list
statement error
SELECT
----
<REGEX>:Parser Error.*clause without selection list.*

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/duckfuzz/regexp_replace_constant.test
# description: regexp_replace
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
SELECT regexp_extract('foobarbaz', 'B..', 0, NULL);
----
must not be NULL
statement error
SELECT regexp_extract('foobarbaz', 'B..', 0, 42);
----
No function matches

View File

@@ -0,0 +1,23 @@
# name: test/fuzzer/duckfuzz/repeat_row_null.test
# description: Repeat row with NULL argument
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
FROM repeat_row(NULL)
----
repeat_rows requires num_rows to be specified
query I
FROM repeat_row(NULL, num_rows=3)
----
NULL
NULL
NULL
statement error
FROM repeat_row(num_rows=3)
----
requires at least one column to be specified

View File

@@ -0,0 +1,38 @@
# name: test/fuzzer/duckfuzz/repeat_wrong_number.test
# description: Repeat row with NULL argument
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
query I
FROM repeat(42, 1)
----
42
query I
FROM repeat(42, 0)
----
statement error
FROM repeat(42, -1)
----
Repeat second parameter cannot be be less than 0
# original issue https://github.com/duckdb/duckdb-fuzzer/issues/2688
statement error
SELECT NULL FROM repeat('7fb6658b-4f42-44ce-bbd0-b22ba2faf7ad', -32768)
----
Repeat second parameter cannot be be less than 0
# original issue https://github.com/duckdb/duckdb-fuzzer/issues/2685
statement error
SELECT NULL FROM repeat(NULL, -9223372036854775808)
----
Repeat second parameter cannot be be less than 0
# original issue https://github.com/duckdb/duckdb-fuzzer/issues/2686
statement error
SELECT NULL FROM repeat(1050, -128)
----
Repeat second parameter cannot be be less than 0

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/duckfuzz/reservoir_issues.test_slow
# description: Issues with reservoir sampling and uninitialized memory (duckdb-fuzzer #324 and #861)
# group: [duckfuzz]
require tpch
statement ok
call dbgen(sf=0.1)
statement ok
SELECT * FROM lineitem USING SAMPLE 91.0% (Reservoir)
statement ok
SELECT c13 FROM lineitem AS t17(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16) GROUP BY ALL USING SAMPLE 72.0% (Reservoir)

View File

@@ -0,0 +1,57 @@
# name: test/fuzzer/duckfuzz/semi_join_has_correct_left_right_relations.test
# description: Test that semi joins have correct left/right columns
# group: [duckfuzz]
statement ok
create table t1 as select range a from range(300);
statement ok
create table t2 as select range b from range(500);
statement ok
create table t3 as select range c from range (600);
statement ok
select * from t1, t2 where a = b and a in (select c from t3);
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement ok
pragma disabled_optimizers='empty_result_pullup';
statement error
SELECT NULL
FROM all_types
INNER JOIN (SELECT NULL)
RIGHT JOIN all_types AS ref_2
LEFT JOIN all_types AS ref_7
INNER JOIN all_types AS ref_8
ON (( ref_7.int_array = ref_8.int_array ))
ON ( NULL )
INNER JOIN all_types AS ref_9
ON ( ref_2."varchar" )
ON (( "Version"() IS NULL ))
ON ( EXISTS(SELECT ref_7."bit" AS c0
FROM all_types AS ref_10
WHERE 0
));
----
<REGEX>:.*Conversion Error:.*
# This one should throw a Conversion Error. However, FilterPullup now pulls up an unsatisfiable join filter,
# * there's a lot of those in this query: "... INNER JOIN ... ON (NULL)"
# so that part of the plan is never executed, and we just get a empty result
query I
SELECT NULL FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 INNER JOIN main.all_types AS ref_2 ON ((SELECT NULL)) INNER JOIN main.all_types ON ((SELECT NULL)) ON (NULL) INNER JOIN main.all_types AS ref_4 ON (ref_4."varchar") INNER JOIN main.all_types AS ref_5 ON (EXISTS(SELECT 79 AS c0 FROM main.all_types AS ref_6 INNER JOIN main.all_types AS ref_7 INNER JOIN main.all_types ON (NULL) ON ((EXISTS(SELECT ref_2.uint AS c0, ref_4."time" AS c1 FROM main.all_types AS ref_9 WHERE (ref_2."varchar" ~~~ ref_5."varchar")) AND (ref_1."varchar" !~~* ref_7."varchar"))) , (SELECT ref_6.utinyint AS c0, (SELECT bit_or(ubigint) FROM main.all_types) AS c1, ref_5.fixed_varchar_array AS c2, ref_10."union" AS c3 FROM main.all_types AS ref_10 WHERE (ref_2."varchar" !~~* ref_0."varchar") LIMIT 159) AS subq_0 WHERE 0 LIMIT 67)) LEFT JOIN main.all_types AS ref_11 ON ((ref_1."time" = ref_11."time")) LIMIT 115
----
# When we disable FilterPullup and EmptyResultPullup we get the expected error
statement ok
set disabled_optimizers to 'filter_pullup,empty_result_pullup'
statement error
SELECT NULL FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 INNER JOIN main.all_types AS ref_2 ON ((SELECT NULL)) INNER JOIN main.all_types ON ((SELECT NULL)) ON (NULL) INNER JOIN main.all_types AS ref_4 ON (ref_4."varchar") INNER JOIN main.all_types AS ref_5 ON (EXISTS(SELECT 79 AS c0 FROM main.all_types AS ref_6 INNER JOIN main.all_types AS ref_7 INNER JOIN main.all_types ON (NULL) ON ((EXISTS(SELECT ref_2.uint AS c0, ref_4."time" AS c1 FROM main.all_types AS ref_9 WHERE (ref_2."varchar" ~~~ ref_5."varchar")) AND (ref_1."varchar" !~~* ref_7."varchar"))) , (SELECT ref_6.utinyint AS c0, (SELECT bit_or(ubigint) FROM main.all_types) AS c1, ref_5.fixed_varchar_array AS c2, ref_10."union" AS c3 FROM main.all_types AS ref_10 WHERE (ref_2."varchar" !~~* ref_0."varchar") LIMIT 159) AS subq_0 WHERE 0 LIMIT 67)) LEFT JOIN main.all_types AS ref_11 ON ((ref_1."time" = ref_11."time")) LIMIT 115
----
<REGEX>:.*Conversion Error:.*

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/duckfuzz/string_to_nested_cast_sample.test
# description: cast strings to lists with a sample
# group: [duckfuzz]
statement ok
CREATE TABLE part AS SELECT concat('this is a long part name', i) AS p_name FROM range(20000) t(i);
query I
SELECT COUNT(*) FILTER (cast_part IS NULL)
FROM (
SELECT TRY_CAST(p_name AS STRUCT(a INTEGER[], b VARCHAR[])) FROM part USING SAMPLE 81.0% (Reservoir)
) t(cast_part)
----
16200

View File

@@ -0,0 +1,19 @@
# name: test/fuzzer/duckfuzz/strptime_const_arg.test
# description: Fuzzyduck issue #1128
# group: [duckfuzz]
statement ok
CREATE TABLE all_types AS
SELECT * EXCLUDE(small_enum, medium_enum, large_enum) FROM test_all_types() LIMIT 0;
statement error
SELECT COLUMNS(list_filter(*, (lambda c43: try_strptime('c29', 'c24'))))
FROM all_types AS t42(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41)
----
<REGEX>:Binder Error.*Star expression.*
statement error
SELECT COLUMNS(list_filter(*, (c43 -> try_strptime('c29', 'c24'))))
FROM all_types AS t42(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41)
----
<REGEX>:Binder Error.*Star expression.*

View File

@@ -0,0 +1,9 @@
# name: test/fuzzer/duckfuzz/temporal_avg.test
# description: Fuzzyduck issue #1128
# group: [duckfuzz]
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement ok
SELECT avg(c1) FROM test_vector_types(CAST(NULL AS TIMESTAMP)) AS test_vector_types(c1);

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/duckfuzz/to_weeks_overflow.test
# description: Check Overflow in to_weeks
# group: [duckfuzz]
statement ok
create table all_types as
select * exclude(small_enum, medium_enum, large_enum)
from test_all_types();
statement error
SELECT to_weeks(#4)
FROM all_types AS t43(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42)
WHERE c9
----
Out of Range Error: Interval value 2147483647 weeks out of range

View File

@@ -0,0 +1,18 @@
# name: test/fuzzer/duckfuzz/try_cast_string_to_list.test_slow
# description: Fuzzyduck issue #2696
# group: [duckfuzz]
require tpch
statement ok
call dbgen(sf=0.1);
query I
SELECT DISTINCT TRY_CAST(c_name AS TIMESTAMP[]) FROM customer USING SAMPLE 63.0% (Reservoir);
----
NULL
query I
SELECT DISTINCT TRY_CAST(c_name AS TIMESTAMP[3]) FROM customer USING SAMPLE 63.0% (Reservoir);
----
NULL

View File

@@ -0,0 +1,14 @@
# name: test/fuzzer/duckfuzz/tuple_data_empty_heap.test
# description: Check if we handle empty heaps correctly (duckdb-fuzzer issue 2690)
# group: [duckfuzz]
require tpch
statement ok
set threads=4;
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement ok
SELECT DISTINCT c1, #1, c3, c1, c3, c1, c2 FROM tpch_answers() AS t4(c1, c2, c3) GROUP BY ALL;

View File

@@ -0,0 +1,9 @@
# name: test/fuzzer/duckfuzz/union_dict_tag.test
# description: Fuzzyduck issue #1139
# group: [duckfuzz]
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement ok
SELECT encode("union"::varchar), "double" FROM all_types where "double";

View File

@@ -0,0 +1,11 @@
# name: test/fuzzer/duckfuzz/unpivot_multiple_in.test
# description: Unpivot with multiple pivot elements
# group: [duckfuzz]
statement ok
PRAGMA enable_verification
statement error
FROM (SELECT 42) AS t1 UNPIVOT (c2 FOR c2 IN (6317) c2 IN (NULL))
----
requires a single pivot element

View File

@@ -0,0 +1,34 @@
# name: test/fuzzer/duckfuzz/vector_type.test
# description: Properly propogate empty results.
# group: [duckfuzz]
require noforcestorage
statement ok
pragma enable_verification
query I
SELECT vector_type(42::INTEGER)
----
CONSTANT_VECTOR
query I
SELECT vector_type(NULL::INTEGER)
----
CONSTANT_VECTOR
statement ok
CREATE TABLE fuu (i INTEGER, j INTEGER);
statement ok
INSERT INTO fuu VALUES (42, NULL), (43, NULL);
statement ok
SELECT vector_type(i), vector_type(j) FROM fuu;
# issue https://github.com/duckdb/duckdb-fuzzer/issues/2683
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
statement ok
SELECT vector_type(COLUMNS(*)) FROM all_types

View File

@@ -0,0 +1,101 @@
# name: test/fuzzer/duckfuzz/visit_operator_expressions_in_column_lifetime_analyzer.test
# description: Properly propogate empty results.
# group: [duckfuzz]
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types() limit 0;
# Issue 1142
query I
SELECT arg_min(CAST(ref_19."varchar" AS VARCHAR), CAST(ref_3."varchar" AS VARCHAR)) OVER (PARTITION BY ref_23."bit" ORDER BY ref_6.ubigint) FROM (SELECT (SELECT "time" FROM main.all_types LIMIT 1 OFFSET 4) AS c1 FROM main.all_types AS ref_0 WHERE ref_0."varchar") AS subq_0 INNER JOIN (SELECT ref_1."varchar" AS c5 FROM main.all_types AS ref_1 LEFT JOIN main.all_types AS ref_2 ON ((ref_1."varchar" !~~* ref_2."varchar")) WHERE (ref_2."varchar" ~~* ref_2."varchar")) AS subq_1 INNER JOIN main.all_types AS ref_3 ON ((subq_1.c5 ~~ ref_3."varchar")) ON ((ref_3."varchar" ~~ subq_1.c5)) INNER JOIN main.all_types AS ref_4 RIGHT JOIN main.all_types AS ref_5 RIGHT JOIN main.all_types AS ref_6 ON ((ref_6."varchar" ^@ ref_6."varchar")) ON ((ref_6.timestamp_ms IS NOT NULL)) INNER JOIN main.all_types AS ref_7 INNER JOIN main.all_types AS ref_8 ON ((ref_7.dec_4_1 = ref_8.dec_4_1)) LEFT JOIN main.all_types AS ref_9 RIGHT JOIN main.all_types AS ref_10 ON ((ref_9.timestamp_array = ref_10.timestamp_array)) ON ((ref_10."varchar" ^@ ref_8."varchar")) INNER JOIN main.all_types AS ref_11 RIGHT JOIN main.all_types AS ref_12 ON ((ref_11."float" = ref_12."float")) LEFT JOIN main.all_types AS ref_13 ON ((ref_11."varchar" ~~~ ref_12."varchar")) ON ((CAST(NULL AS VARCHAR) ~~~ ref_7."varchar")) ON (((((ref_8."varchar" !~~ ref_8."varchar") AND (ref_6."varchar" ~~~ ref_12."varchar")) OR (ref_9."varchar" ~~ CAST(NULL AS VARCHAR))) AND (ref_6."varchar" ^@ ref_8."varchar") AND (ref_11.hugeint IS NOT NULL))) RIGHT JOIN (SELECT (SELECT bool FROM main.all_types LIMIT 1 OFFSET 6) AS c4) AS subq_2 ON ((ref_9."varchar" !~~ ref_8."varchar")) ON ((ref_3."int" = ref_10."int")) INNER JOIN (SELECT 41 AS c0 FROM main.all_types AS ref_15 RIGHT JOIN main.all_types AS ref_16 ON ((ref_15."varchar" = ref_16."varchar"))) AS subq_3 INNER JOIN (SELECT ref_17.timestamp_s AS c5 FROM main.all_types AS ref_17) AS subq_4 ON ((subq_3.c0 IS NULL)) INNER JOIN main.all_types AS ref_18 LEFT JOIN main.all_types AS ref_19 INNER JOIN main.all_types AS ref_20 INNER JOIN main.all_types AS ref_21 ON (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 4) ~~~ ref_21."varchar")) ON ((ref_21."timestamp" IS NULL)) ON ((ref_19."varchar" ~~~ ref_20."varchar")) RIGHT JOIN main.all_types AS ref_22 LEFT JOIN main.all_types AS ref_23 ON (1) ON (0) ON ((0 OR (ref_20."varchar" !~~* ref_19."varchar") OR ((EXISTS(SELECT (SELECT tinyint FROM main.all_types LIMIT 1 OFFSET 1) AS c0 FROM main.all_types AS ref_24 WHERE (ref_23."bigint" IS NOT NULL) LIMIT 110) OR (ref_23.timestamp_array IS NULL)) AND (ref_21."varchar" ^@ ref_21."varchar")))) ON ((ref_9."varchar" ~~* chr(CAST(ref_18."int" AS INTEGER)))) WHERE (ref_12."varchar" ^@ ref_20."varchar");
----
statement ok
pragma enable_verification
statement ok
SELECT count_star()
OVER (PARTITION BY ref_1.hugeint, ref_1."timestamp" ORDER BY subq_0.c0) AS c0
FROM
(SELECT
ref_0."int" AS c0,
ref_0.timestamp_s AS c1
FROM main.all_types AS ref_0
WHERE
ref_0."varchar") AS subq_0
INNER JOIN
main.all_types AS ref_1
ON
((subq_0.c1 = ref_1.timestamp_s))
WHERE (ref_1."time" IS NOT NULL);
# Issue 1142
statement ok
SELECT arg_min(CAST(ref_19."varchar" AS VARCHAR), CAST(ref_3."varchar" AS VARCHAR)) OVER (PARTITION BY ref_23."bit" ORDER BY ref_6.ubigint) FROM (SELECT (SELECT "time" FROM main.all_types LIMIT 1 OFFSET 4) AS c1 FROM main.all_types AS ref_0 WHERE ref_0."varchar") AS subq_0 INNER JOIN (SELECT ref_1."varchar" AS c5 FROM main.all_types AS ref_1 LEFT JOIN main.all_types AS ref_2 ON ((ref_1."varchar" !~~* ref_2."varchar")) WHERE (ref_2."varchar" ~~* ref_2."varchar")) AS subq_1 INNER JOIN main.all_types AS ref_3 ON ((subq_1.c5 ~~ ref_3."varchar")) ON ((ref_3."varchar" ~~ subq_1.c5)) INNER JOIN main.all_types AS ref_4 RIGHT JOIN main.all_types AS ref_5 RIGHT JOIN main.all_types AS ref_6 ON ((ref_6."varchar" ^@ ref_6."varchar")) ON ((ref_6.timestamp_ms IS NOT NULL)) INNER JOIN main.all_types AS ref_7 INNER JOIN main.all_types AS ref_8 ON ((ref_7.dec_4_1 = ref_8.dec_4_1)) LEFT JOIN main.all_types AS ref_9 RIGHT JOIN main.all_types AS ref_10 ON ((ref_9.timestamp_array = ref_10.timestamp_array)) ON ((ref_10."varchar" ^@ ref_8."varchar")) INNER JOIN main.all_types AS ref_11 RIGHT JOIN main.all_types AS ref_12 ON ((ref_11."float" = ref_12."float")) LEFT JOIN main.all_types AS ref_13 ON ((ref_11."varchar" ~~~ ref_12."varchar")) ON ((CAST(NULL AS VARCHAR) ~~~ ref_7."varchar")) ON (((((ref_8."varchar" !~~ ref_8."varchar") AND (ref_6."varchar" ~~~ ref_12."varchar")) OR (ref_9."varchar" ~~ CAST(NULL AS VARCHAR))) AND (ref_6."varchar" ^@ ref_8."varchar") AND (ref_11.hugeint IS NOT NULL))) RIGHT JOIN (SELECT (SELECT bool FROM main.all_types LIMIT 1 OFFSET 6) AS c4) AS subq_2 ON ((ref_9."varchar" !~~ ref_8."varchar")) ON ((ref_3."int" = ref_10."int")) INNER JOIN (SELECT 41 AS c0 FROM main.all_types AS ref_15 RIGHT JOIN main.all_types AS ref_16 ON ((ref_15."varchar" = ref_16."varchar"))) AS subq_3 INNER JOIN (SELECT ref_17.timestamp_s AS c5 FROM main.all_types AS ref_17) AS subq_4 ON ((subq_3.c0 IS NULL)) INNER JOIN main.all_types AS ref_18 LEFT JOIN main.all_types AS ref_19 INNER JOIN main.all_types AS ref_20 INNER JOIN main.all_types AS ref_21 ON (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 4) ~~~ ref_21."varchar")) ON ((ref_21."timestamp" IS NULL)) ON ((ref_19."varchar" ~~~ ref_20."varchar")) RIGHT JOIN main.all_types AS ref_22 LEFT JOIN main.all_types AS ref_23 ON (1) ON (0) ON ((0 OR (ref_20."varchar" !~~* ref_19."varchar") OR ((EXISTS(SELECT (SELECT tinyint FROM main.all_types LIMIT 1 OFFSET 1) AS c0 FROM main.all_types AS ref_24 WHERE (ref_23."bigint" IS NOT NULL) LIMIT 110) OR (ref_23.timestamp_array IS NULL)) AND (ref_21."varchar" ^@ ref_21."varchar")))) ON ((ref_9."varchar" ~~* chr(CAST(ref_18."int" AS INTEGER)))) WHERE (ref_12."varchar" ^@ ref_20."varchar");
# Issue 1142 minimal example
statement ok
SELECT arg_min(CAST(ref_5."varchar" AS VARCHAR), CAST(ref_4."varchar" AS VARCHAR)) OVER (PARTITION BY ref_5."bit")
FROM main.all_types AS ref_4
INNER JOIN main.all_types AS ref_5 ON (ref_5.hugeint IS NOT NULL)
INNER JOIN main.all_types AS ref_7 ON (ref_4."int" = ref_5."int")
# Issue 1136
statement ok
SELECT subq_0.c3 AS c3 FROM (SELECT ref_1.timestamp_s AS c0, ref_2.date_array AS c1, ref_2.struct_of_arrays AS c2, ref_2."smallint" AS c3 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 LEFT JOIN main.all_types AS ref_2 INNER JOIN main.all_types AS ref_3 ON (1) ON ((ref_1.dec_4_1 = ref_2.dec_4_1)) ON ((ref_2."float" IS NOT NULL)) WHERE (ref_3."varchar" !~~* ref_1."varchar")) AS subq_0 , (SELECT subq_0.c1 AS c2, subq_0.c2 AS c5, subq_0.c0 AS c13) AS subq_1;
# Issue 1145
statement ok
SELECT subq_0.c4 AS c1 FROM (SELECT ref_5.varchar_array AS c4, ref_2.usmallint AS c5 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 ON ((ref_1."varchar" !~~* ref_0."varchar")) LEFT JOIN main.all_types AS ref_2 RIGHT JOIN main.all_types AS ref_3 ON ((ref_2."bigint" = ref_3."bigint")) ON ((ref_0.timestamp_tz = ref_2.timestamp_tz)) INNER JOIN main.all_types AS ref_4 ON ((ref_3.dec_18_6 IS NOT NULL)) INNER JOIN main.all_types AS ref_5 ON ((ref_3."varchar" ^@ ref_1."varchar")) WHERE EXISTS(SELECT ref_5.blob AS c0, ref_3.ubigint AS c1 FROM main.all_types AS ref_6 WHERE (ref_2."varchar" !~~* ref_4."varchar") LIMIT 120)) AS subq_0 WHERE EXISTS(SELECT ref_7."map" AS c0, subq_0.c5 AS c1 FROM main.all_types AS ref_7 WHERE (ref_7."varchar" ~~~ ref_7."varchar") LIMIT 118)
# Issue 1169
statement ok
SELECT NULL FROM (SELECT ref_0."int" AS c3 FROM main.all_types AS ref_0 RIGHT JOIN main.all_types AS ref_1 INNER JOIN main.all_types AS ref_2 ON ((ref_1."int" = ref_2."int")) INNER JOIN main.all_types AS ref_3 ON ((ref_2.tinyint = ref_3.tinyint)) ON ((ref_2."varchar" ~~* ref_3."varchar")) WHERE (ref_2."smallint" IS NOT NULL)) AS subq_0
# try statements with data
statement ok
insert into all_types select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
# check again with data
statement error
SELECT count_star()
OVER (PARTITION BY ref_1.hugeint, ref_1."timestamp" ORDER BY subq_0.c0) AS c0
FROM
(SELECT
ref_0."int" AS c0,
ref_0.timestamp_s AS c1
FROM main.all_types AS ref_0
WHERE
ref_0."varchar") AS subq_0
INNER JOIN
main.all_types AS ref_1
ON
((subq_0.c1 = ref_1.timestamp_s))
WHERE (ref_1."time" IS NOT NULL);
----
Conversion Error
# Issue 1142, removed conversion error
statement ok
SELECT arg_min(CAST(ref_19."varchar" AS VARCHAR), CAST(ref_3."varchar" AS VARCHAR)) OVER (PARTITION BY ref_23."bit" ORDER BY ref_6.ubigint) FROM (SELECT (SELECT "time" FROM main.all_types LIMIT 1 OFFSET 4) AS c1 FROM main.all_types AS ref_0) AS subq_0 INNER JOIN (SELECT ref_1."varchar" AS c5 FROM main.all_types AS ref_1 LEFT JOIN main.all_types AS ref_2 ON ((ref_1."varchar" !~~* ref_2."varchar")) WHERE (ref_2."varchar" ~~* ref_2."varchar")) AS subq_1 INNER JOIN main.all_types AS ref_3 ON ((subq_1.c5 ~~ ref_3."varchar")) ON ((ref_3."varchar" ~~ subq_1.c5)) INNER JOIN main.all_types AS ref_4 RIGHT JOIN main.all_types AS ref_5 RIGHT JOIN main.all_types AS ref_6 ON ((ref_6."varchar" ^@ ref_6."varchar")) ON ((ref_6.timestamp_ms IS NOT NULL)) INNER JOIN main.all_types AS ref_7 INNER JOIN main.all_types AS ref_8 ON ((ref_7.dec_4_1 = ref_8.dec_4_1)) LEFT JOIN main.all_types AS ref_9 RIGHT JOIN main.all_types AS ref_10 ON ((ref_9.timestamp_array = ref_10.timestamp_array)) ON ((ref_10."varchar" ^@ ref_8."varchar")) INNER JOIN main.all_types AS ref_11 RIGHT JOIN main.all_types AS ref_12 ON ((ref_11."float" = ref_12."float")) LEFT JOIN main.all_types AS ref_13 ON ((ref_11."varchar" ~~~ ref_12."varchar")) ON ((CAST(NULL AS VARCHAR) ~~~ ref_7."varchar")) ON (((((ref_8."varchar" !~~ ref_8."varchar") AND (ref_6."varchar" ~~~ ref_12."varchar")) OR (ref_9."varchar" ~~ CAST(NULL AS VARCHAR))) AND (ref_6."varchar" ^@ ref_8."varchar") AND (ref_11.hugeint IS NOT NULL))) RIGHT JOIN (SELECT (SELECT bool FROM main.all_types LIMIT 1 OFFSET 6) AS c4) AS subq_2 ON ((ref_9."varchar" !~~ ref_8."varchar")) ON ((ref_3."int" = ref_10."int")) INNER JOIN (SELECT 41 AS c0 FROM main.all_types AS ref_15 RIGHT JOIN main.all_types AS ref_16 ON ((ref_15."varchar" = ref_16."varchar"))) AS subq_3 INNER JOIN (SELECT ref_17.timestamp_s AS c5 FROM main.all_types AS ref_17) AS subq_4 ON ((subq_3.c0 IS NULL)) INNER JOIN main.all_types AS ref_18 LEFT JOIN main.all_types AS ref_19 INNER JOIN main.all_types AS ref_20 INNER JOIN main.all_types AS ref_21 ON (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 4) ~~~ ref_21."varchar")) ON ((ref_21."timestamp" IS NULL)) ON ((ref_19."varchar" ~~~ ref_20."varchar")) RIGHT JOIN main.all_types AS ref_22 LEFT JOIN main.all_types AS ref_23 ON (1) ON (0) ON ((0 OR (ref_20."varchar" !~~* ref_19."varchar") OR ((EXISTS(SELECT (SELECT tinyint FROM main.all_types LIMIT 1 OFFSET 1) AS c0 FROM main.all_types AS ref_24 WHERE (ref_23."bigint" IS NOT NULL) LIMIT 110) OR (ref_23.timestamp_array IS NULL)) AND (ref_21."varchar" ^@ ref_21."varchar")))) ON ((ref_9."varchar" ~~* chr(CAST(ref_18."int" AS INTEGER)))) WHERE (ref_12."varchar" ^@ ref_20."varchar");
# Issue 1142 minimal example
statement ok
SELECT arg_min(CAST(ref_5."varchar" AS VARCHAR), CAST(ref_4."varchar" AS VARCHAR)) OVER (PARTITION BY ref_5."bit")
FROM main.all_types AS ref_4
INNER JOIN main.all_types AS ref_5 ON (ref_5.hugeint IS NOT NULL)
INNER JOIN main.all_types AS ref_7 ON (ref_4."int" = ref_5."int")
# Issue 1136
statement ok
SELECT subq_0.c3 AS c3 FROM (SELECT ref_1.timestamp_s AS c0, ref_2.date_array AS c1, ref_2.struct_of_arrays AS c2, ref_2."smallint" AS c3 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 LEFT JOIN main.all_types AS ref_2 INNER JOIN main.all_types AS ref_3 ON (1) ON ((ref_1.dec_4_1 = ref_2.dec_4_1)) ON ((ref_2."float" IS NOT NULL)) WHERE (ref_3."varchar" !~~* ref_1."varchar")) AS subq_0 , (SELECT subq_0.c1 AS c2, subq_0.c2 AS c5, subq_0.c0 AS c13) AS subq_1;
# Issue 1145
statement ok
SELECT subq_0.c4 AS c1 FROM (SELECT ref_5.varchar_array AS c4, ref_2.usmallint AS c5 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 ON ((ref_1."varchar" !~~* ref_0."varchar")) LEFT JOIN main.all_types AS ref_2 RIGHT JOIN main.all_types AS ref_3 ON ((ref_2."bigint" = ref_3."bigint")) ON ((ref_0.timestamp_tz = ref_2.timestamp_tz)) INNER JOIN main.all_types AS ref_4 ON ((ref_3.dec_18_6 IS NOT NULL)) INNER JOIN main.all_types AS ref_5 ON ((ref_3."varchar" ^@ ref_1."varchar")) WHERE EXISTS(SELECT ref_5.blob AS c0, ref_3.ubigint AS c1 FROM main.all_types AS ref_6 WHERE (ref_2."varchar" !~~* ref_4."varchar") LIMIT 120)) AS subq_0 WHERE EXISTS(SELECT ref_7."map" AS c0, subq_0.c5 AS c1 FROM main.all_types AS ref_7 WHERE (ref_7."varchar" ~~~ ref_7."varchar") LIMIT 118)
# Issue 1169
statement ok
SELECT NULL FROM (SELECT ref_0."int" AS c3 FROM main.all_types AS ref_0 RIGHT JOIN main.all_types AS ref_1 INNER JOIN main.all_types AS ref_2 ON ((ref_1."int" = ref_2."int")) INNER JOIN main.all_types AS ref_3 ON ((ref_2.tinyint = ref_3.tinyint)) ON ((ref_2."varchar" ~~* ref_3."varchar")) WHERE (ref_2."smallint" IS NOT NULL)) AS subq_0

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/duckfuzz/window_expression_equality.test
# description: Window expression equality test
# group: [duckfuzz]
statement ok
pragma enable_verification
statement ok
create table all_types(c1 BOOL, c9 SMALLINT, c10 UINTEGER, c36 VARCHAR[]);
statement ok
SELECT
first_value(c9) OVER (PARTITION BY c10, c1, c9, (c36 IS NOT DISTINCT FROM c36) ROWS BETWEEN 8201 PRECEDING AND CURRENT ROW),
first_value(c9) OVER (PARTITION BY c10, c9, c9, (c36 IS NOT DISTINCT FROM c36) ROWS BETWEEN 8201 PRECEDING AND CURRENT ROW)
FROM all_types

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/duckfuzz/window_negate_stats.test
# description: Negate extreme window statistics.
# group: [duckfuzz]
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
query I
SELECT max(c33) FILTER (WHERE c25) OVER (PARTITION BY c22 ROWS BETWEEN c5 PRECEDING AND CURRENT ROW)
FROM all_types AS t43(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43)
ORDER BY ALL NULLS LAST
----
[]
[42.0, nan, inf, -inf, NULL, -42.0]
NULL

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/duckfuzz/window_null_range.test
# description: Negate extreme window statistics.
# group: [duckfuzz]
statement ok
create table all_types as select * exclude(small_enum, medium_enum, large_enum)
from test_all_types();
statement error
SELECT percent_rank() OVER (PARTITION BY c21 ORDER BY c37 ASC NULLS FIRST RANGE BETWEEN NULL FOLLOWING AND UNBOUNDED FOLLOWING)
FROM all_types AS t43(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42)
----
Window RANGE expressions cannot be NULL

View File

@@ -0,0 +1,21 @@
# name: test/fuzzer/duckfuzz/window_order_bind_failure.test
# description: Give up fast on window binding order by failures
# group: [duckfuzz]
statement ok
CREATE TABLE all_types AS SELECT * EXCLUDE(small_enum, medium_enum, large_enum)
FROM test_all_types();
statement error
SELECT lead(#1) OVER (PARTITION BY 2378 ORDER BY ((c70 BETWEEN c90 AND c19) AND c51) ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND c7 FOLLOWING)
FROM all_types AS t91(c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c59, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72, c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84, c85, c86, c87, c88, c89, c90)
----
Binder Error
statement error
SELECT #3, first_value(c20) OVER (ORDER BY c40 NULLS LAST ROWS BETWEEN generate_subscripts(c35, -2147483648) PRECEDING AND c14 PRECEDING)
FROM all_types AS t42(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41)
WHERE c28
----
UNNEST not supported here

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/fuzz_not_operator.test
# group: [fuzzer]
statement ok
pragma enable_verification
# Because 2060771621 + -2134619525 becomes bigger than INTEGER (detected type for the constants)
# previously we would wrongfully strip the where clause and return an empty set.
query I
SELECT i FROM (select 1) tbl(i) WHERE ( 2060771621 != i + -2134619525 )
----
1
query I
select i FROM (select 4195391146) tbl(i) WHERE ( 2060771621 != i + -2134619525)
----

View File

@@ -0,0 +1,40 @@
# name: test/fuzzer/fuzz_not_unpacked_columns.test
# group: [fuzzer]
statement ok
CREATE TABLE v00 (c01 INT, c02 STRING);
statement error
SELECT NOT (*COLUMNS(*)) FROM v00;
----
Binder Error: *COLUMNS() can not be used together with the 'OPERATOR_NOT' operator
statement error
SELECT (*COLUMNS(*) IS NOT NULL) FROM v00;
----
Binder Error: *COLUMNS() can not be used together with the 'OPERATOR_IS_NOT_NULL' operator
statement error
SELECT (*COLUMNS(*) IS NULL) FROM v00;
----
Binder Error: *COLUMNS() can not be used together with the 'OPERATOR_IS_NULL' operator
statement error
SELECT (*COLUMNS(*))[2] FROM v00;
----
Binder Error: *COLUMNS() can not be used together with the 'ARRAY_EXTRACT' operator
statement error
SELECT (*COLUMNS(*))[2:1:0] FROM v00;
----
Binder Error: *COLUMNS() can not be used together with the 'ARRAY_SLICE' operator
statement error
SELECT (*COLUMNS(*)).a FROM v00;
----
Binder Error: *COLUMNS() can not be used together with the 'STRUCT_EXTRACT' operator
statement error
SELECT construct_array(*COLUMNS(*)) FROM v00;
----
Binder Error: *COLUMNS() can not be used together with the 'ARRAY_CONSTRUCTOR' operator

View File

@@ -0,0 +1,13 @@
# name: test/fuzzer/nthvalue_indexing.test
# description: Test partitions > chunk size
# group: [fuzzer]
require tpch
statement ok
call dbgen(sf=0.1);
statement ok
SELECT DISTINCT nth_value(NULL, (c2 IS NOT NULL)) OVER (PARTITION BY 1585 ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
FROM part AS t10(c1, c2, c3, c4, c5, c6, c7, c8, c9)
ORDER BY * ASC NULLS LAST

View File

@@ -0,0 +1,25 @@
# name: test/fuzzer/pedro/C_C++_API_query_verification.test
# description: Issue #5984 (25): C/C++ API missing backslash interpretation
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0 (c0 INT);
statement ok
INSERT INTO t0 VALUES (1), (-2), (0);
statement ok
UPDATE t0 SET c0 = (~1);
query I
SELECT c0 FROM t0;
----
-2
-2
-2
statement ok
SELECT CAST((((1!) << CASE WHEN 1 THEN 1 WHEN 1 THEN 1 END) IS NULL) AS USMALLINT)

View File

@@ -0,0 +1,34 @@
# name: test/fuzzer/pedro/aggregate_assertion_errors.test
# description: Various aggregate assertion errors
# group: [pedro]
statement ok
PRAGMA enable_verification
query I
SELECT reservoir_quantile(1, 1 ORDER BY 1);
----
1
statement ok
CREATE TABLE t1 (c0 INT);
query I
SELECT entropy(1 ORDER BY 1) FROM t1;
----
0
query I
SELECT approx_count_distinct(1 ORDER BY 1) FROM t1;
----
0
query I
SELECT count(c0 ORDER BY 0) FROM (SELECT 2 EXCEPT SELECT 2) c0;
----
0
query I
SELECT mode((c0, 0)) FROM (SELECT 1 c0), (SELECT 2);
----
(1, 0)

View File

@@ -0,0 +1,39 @@
# name: test/fuzzer/pedro/alter_column_generated.test
# description: Issue #4677: heap-buffer-overflow on ALTER statement
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c0 AS (1), c1 INT);
statement ok
ALTER TABLE t0 ALTER c1 SET NOT NULL;
statement ok
ALTER TABLE t0 ALTER c1 SET NOT NULL;
statement error
ALTER TABLE t0 ALTER c0 SET NOT NULL;
----
<REGEX>:Binder Error.*Unsupported constraint.*
statement error
INSERT INTO t0 VALUES (NULL);
----
<REGEX>:Constraint Error.*NOT NULL.*failed.*
statement ok
DROP TABLE t0;
statement ok
CREATE TABLE t0(c0 AS (1), c1 INT);
statement ok
INSERT INTO t0 VALUES (NULL);
statement error
ALTER TABLE t0 ALTER c1 SET NOT NULL;
----
<REGEX>:Constraint Error.*NOT NULL.*failed.*

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/pedro/alter_dependencies.test
# description: Issue #4696: Alter table dependency conflict
# group: [pedro]
statement ok
CREATE TABLE t1 (c2 INT, c1 INT);
statement ok
CREATE INDEX i1 ON t1 (c1);
statement ok
START TRANSACTION;
statement error
ALTER TABLE t1 ALTER c2 TYPE BOOLEAN;
----
Cannot alter
# committing triggers a rollback
statement ok
COMMIT;
statement error
ALTER TABLE t1 ALTER c2 SET NOT NULL;
----
Cannot alter

View File

@@ -0,0 +1,26 @@
# name: test/fuzzer/pedro/alter_dependency_conflict.test
# description: Issue #4696: Alter table dependency conflict
# group: [pedro]
load __TEST_DIR__/alter_dependency_conflict.db
statement ok
CREATE TABLE t4 (c0 DATE, c3 VARCHAR(10));
statement ok
CREATE INDEX i2 ON t4 (c3);
statement ok
ALTER TABLE t4 ADD c1 BLOB;
statement ok
INSERT INTO t4 VALUES (NULL, NULL, NULL)
statement ok
START TRANSACTION;
statement ok
CREATE INDEX i3 ON t4 (c3);
statement ok
COMMIT;

View File

@@ -0,0 +1,29 @@
# name: test/fuzzer/pedro/alter_table_rowid.test
# description: Issue #4587: Alter table statements with rowid column
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c0 INTEGER, c1 INTEGER);
statement error
ALTER TABLE t0 DROP COLUMN rowid;
----
<REGEX>:Binder Error.*does not have a column with name.*
statement error
ALTER TABLE t0 RENAME rowid TO ups;
----
<REGEX>:Binder Error.*does not have a column with name.*
statement error
ALTER TABLE t0 ALTER rowid TYPE VARCHAR;
----
<REGEX>:Binder Error.*does not have a column with name.*
statement error
ALTER TABLE t0 ALTER rowidx SET DEFAULT 0;
----
<REGEX>:Binder Error.*does not have a column with name.*

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/alter_type_null_mix.test
# description: ALTER TYPE large with mix of NULLs and non-nulls
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1 (c0 USMALLINT);
statement ok
INSERT INTO t1 SELECT CASE WHEN i%2=0 THEN NULL ELSE 0 END FROM range(3000) t(i);
statement ok
ALTER TABLE t1 ALTER c0 TYPE USMALLINT;

View File

@@ -0,0 +1,16 @@
# name: test/fuzzer/pedro/alter_virtual_column_segfault.test
# description: Alter type of virtual column crashes
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t1(c2 AS (1) VIRTUAL, c1 TIME WITH TIME ZONE);
statement error
ALTER TABLE t1 ALTER c1 TYPE TIME USING(c2);
----
generated columns

View File

@@ -0,0 +1,10 @@
# name: test/fuzzer/pedro/analyze_nonexistant.test
# group: [pedro]
statement ok
CREATE TABLE t0(c0 TINYINT);
statement error
ANALYZE t0(c4);
----
does not exist

View File

@@ -0,0 +1,31 @@
# name: test/fuzzer/pedro/another_binder_error.test
# description: Issue #4978 (issue 48): Another Binder Issue
# group: [pedro]
mode skip
statement error
SELECT avg(0) c0, (SELECT 0 OFFSET c0);
----
Correlated columns not supported in LIMIT/OFFSET
statement error
SELECT avg(0) c0, (SELECT 0 OFFSET c0 + 1);
----
Correlated columns not supported in LIMIT/OFFSET
query II
SELECT 1 c0, (SELECT 0 OFFSET c0 - 1);
----
1 0
statement error
SELECT (SELECT avg(0)) c0, (SELECT 0 OFFSET c0 + 1);
----
Serialization Error: Cannot copy BoundSubqueryExpression
query II
select avg(0) AS c0, (SELECT c0);
----
0.0 0.0

View File

@@ -0,0 +1,15 @@
# name: test/fuzzer/pedro/art_concatenate_prefix.test
# description: Issue #7128, number 14
# group: [pedro]
statement ok
CREATE TABLE t0(c0 INT);
statement ok
CREATE INDEX i0 ON t0 (c0, (BLOB '\xE7\x1F\x8B&\xF0'));
statement ok
INSERT INTO t0 VALUES (-2041046163), (35016222);
statement ok
TRUNCATE t0;

View File

@@ -0,0 +1,10 @@
# name: test/fuzzer/pedro/art_prefix_error.test
# description: Issue #5984, number 59
# group: [pedro]
statement ok
CREATE TABLE t0 (c0 BLOB PRIMARY KEY);
statement ok
INSERT INTO t0(c0) VALUES (BLOB '\x00a'), (BLOB '');

Some files were not shown because too many files have changed in this diff Show More