duckdb / duckdb-fuzzer

Repository that contains automatic reports of issues found through fuzzing DuckDB
0 stars 0 forks source link

ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "c1" [134.8] (bindings: {#[92.0], #[75.0], #[75.1]}) #3195

Closed fuzzerofducks closed 3 months ago

fuzzerofducks commented 3 months ago

Issue found by SQLSmith on git commit hash 50bb6 using seed 882343245.

To Reproduce

create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types() limit 0;
SELECT NULL FROM (SELECT ref_1.timestamp_array AS c0, ref_4.uuid AS c1, icu_collate_yue(CAST(ref_4."varchar" AS VARCHAR)) AS c2, ref_3.double_array AS c3, (SELECT "bigint" FROM main.all_types LIMIT 1 OFFSET 1) AS c4 FROM main.all_types AS ref_0 RIGHT JOIN main.all_types AS ref_1 ON ((ref_1."varchar" ~~ ref_1."varchar")) LEFT JOIN main.all_types AS ref_2 INNER JOIN main.all_types AS ref_3 ON ((ref_2.ubigint = ref_3.ubigint)) ON ((56 IS NULL)) INNER JOIN main.all_types AS ref_4 ON ((ref_1.timestamp_ms = ref_4.timestamp_ms)) WHERE ((ref_1."varchar" !~~* ref_2."varchar") AND ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 6) !~~ ref_3."varchar"))) AS subq_0 INNER JOIN (SELECT subq_6.c1 AS c0, subq_6.c0 AS c1 FROM main.all_types AS ref_5 , (SELECT ref_5.usmallint AS c0, ref_5.dec38_10 AS c1 FROM main.all_types AS ref_6 , (SELECT ref_6.dec_18_6 AS c0, ref_5.double_array AS c1, subq_1.c2 AS c2, ref_6.struct_of_arrays AS c3, (SELECT struct_of_fixed_array FROM main.all_types LIMIT 1 OFFSET 5) AS c4, subq_2.c0 AS c5, subq_4.c2 AS c6, subq_3.c0 AS c7, subq_1.c1 AS c8 FROM main.all_types AS ref_7 , (SELECT 52 AS c0, ref_8."interval" AS c1, ref_8.hugeint AS c2 FROM main.all_types AS ref_8 WHERE ((83 IS NULL) AND 0)) AS subq_1 , (SELECT subq_1.c0 AS c0, 56 AS c1 FROM main.all_types AS ref_9 WHERE 1 LIMIT 41) AS subq_2 , (SELECT ref_6.timestamp_tz AS c0, ref_10.fixed_nested_int_array AS c1, ref_7.timestamp_ns AS c2 FROM main.all_types AS ref_10 WHERE 1 LIMIT 147) AS subq_3 , (SELECT ref_6.timestamp_s AS c0, subq_2.c1 AS c1, subq_2.c1 AS c2 FROM main.all_types AS ref_11 WHERE (ref_11."varchar" ^@ ref_5."varchar") LIMIT 119) AS subq_4 WHERE (ref_7."varchar" ^@ ref_6."varchar")) AS subq_5 WHERE 0 LIMIT 123) AS subq_6 WHERE EXISTS(SELECT ref_12."smallint" AS c0, subq_6.c0 AS c1, ref_5.timestamp_ns AS c2, subq_6.c0 AS c3, ref_12.uuid AS c4, 3 AS c5, ref_12.fixed_int_array AS c6, ref_12."bigint" AS c7 FROM main.all_types AS ref_12 WHERE (ref_12."varchar" ~~* ref_5."varchar") LIMIT 120)) AS subq_7 RIGHT JOIN (SELECT ref_13.uint AS c0 FROM main.all_types AS ref_13 INNER JOIN main.all_types AS ref_14 LEFT JOIN main.all_types AS ref_15 ON ((ref_14.fixed_array_of_int_list = ref_15.fixed_array_of_int_list)) INNER JOIN main.all_types AS ref_16 ON ((1 AND (ref_15."varchar" ~~* ref_16."varchar"))) ON ((ref_15.timestamp_array IS NULL)) WHERE ((SELECT fixed_nested_varchar_array FROM main.all_types LIMIT 1 OFFSET 1) IS NULL)) AS subq_8 ON (0) ON ((subq_0.c2 !~~* subq_0.c2)) WHERE EXISTS(SELECT NULL, subq_0.c1 AS c1, NULL, 19 AS c3, NULL FROM (SELECT subq_7.c0 AS c4, subq_7.c1 AS c5 FROM main.all_types INNER JOIN main.all_types AS ref_18 ON (EXISTS(SELECT subq_8.c0 AS c0 FROM main.all_types AS ref_19 WHERE (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3))) INNER JOIN main.all_types AS ref_20 ON (0) LIMIT 11))

Error Message

ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "c1" [134.8] (bindings: {#[92.0], #[75.0], #[75.1]})