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 "c0" [36.5] (bindings: {#[139.0], #[139.1]}) #3165

Closed fuzzerofducks closed 3 months ago

fuzzerofducks commented 3 months ago

Issue found by SQLSmith on git commit hash dd9e6 using seed 721727976.

To Reproduce

create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
SELECT NULL FROM (SELECT length(CAST(ref_0."bit" AS BIT)) AS c0 FROM main.all_types AS ref_0 RIGHT JOIN main.all_types AS ref_1 ON ((ref_0.fixed_array_of_int_list = ref_1.fixed_array_of_int_list)) INNER JOIN (SELECT ref_2.fixed_nested_int_array AS c0, ref_2.fixed_nested_int_array AS c1, ref_2."smallint" AS c2 FROM main.all_types AS ref_2 WHERE (ref_2."varchar" !~~ ref_2."varchar") LIMIT 81) AS subq_0 ON (((ref_0."timestamp" IS NOT NULL) OR (ref_0.uint IS NOT NULL))) WHERE ("version"() !~~* ref_1."varchar") LIMIT 161) AS subq_1 WHERE (CASE  WHEN (EXISTS(SELECT subq_1.c0 AS c0, subq_1.c0 AS c1, ref_3."float" AS c2, CASE  WHEN ((((ref_3."varchar" ~~ ref_3."varchar") OR 0) AND (ref_3."varchar" ^@ ref_3."varchar"))) THEN (ref_3.date) ELSE ref_3.date END AS c3, subq_1.c0 AS c4, ref_3.fixed_varchar_array AS c5, subq_1.c0 AS c6, subq_1.c0 AS c7, subq_1.c0 AS c8, make_time(CAST(ref_3."bigint" AS BIGINT), CAST(ref_3."bigint" AS BIGINT), CAST(ref_3."bigint" AS BIGINT)) AS c9, (SELECT usmallint FROM main.all_types LIMIT 1 OFFSET 4) AS c10, ref_3."varchar" AS c11, ref_3.dec_4_1 AS c12, ref_3.dec38_10 AS c13, ref_3.timestamptz_array AS c14 FROM main.all_types AS ref_3 WHERE ((ref_3."varchar" !~~* ref_3."varchar") OR EXISTS(SELECT ref_4."map" AS c0, subq_1.c0 AS c1 FROM main.all_types AS ref_4 WHERE EXISTS(SELECT ref_4.uint AS c0, ref_3."union" AS c1, ref_5.timestamp_array AS c2, subq_1.c0 AS c3, ref_4.utinyint AS c4 FROM main.all_types AS ref_5 WHERE ((ref_5."varchar" ~~* ref_5."varchar") AND (CAST(NULL AS VARCHAR) ^@ ref_4."varchar")) LIMIT 136) LIMIT 50) OR 0) LIMIT 44)) THEN (CAST(COALESCE(CAST(COALESCE((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 2), current_database()) AS VARCHAR), CAST(COALESCE(CASE  WHEN ((((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 2) ~~ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1)) OR 1)) THEN (CAST(NULL AS VARCHAR)) ELSE CAST(NULL AS VARCHAR) END, (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3)) AS VARCHAR)) AS VARCHAR)) ELSE COALESCE((SELECT NULL), COALESCE(CASE  WHEN (((SELECT NULL) ~~ (SELECT NULL FROM main.all_types LIMIT 1 OFFSET 1))) THEN (NULL) ELSE NULL END, (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3))) END !~~ CASE  WHEN (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1) ~~~ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3))) THEN ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 79)) ELSE (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 79) END)

Error Message

ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "c0" [36.5] (bindings: {#[139.0], #[139.1]})