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 "c3" [162.3] (bindings: {#[107.0], #[107.1], #[107.2], #[107.3], #[107.4], #[107.5], #[107.6], #[107.7]}) #3177

Closed fuzzerofducks closed 3 months ago

fuzzerofducks commented 3 months ago

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

To Reproduce

create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
SELECT NULL FROM (SELECT subq_2.c3 AS c0, subq_3.c1 AS c1, subq_2.c4 AS c2, subq_2.c4 AS c3, lcm(CAST(CAST(NULL AS HUGEINT) AS HUGEINT), CAST(sum(CAST((SELECT hugeint FROM main.all_types LIMIT 1 OFFSET 6) AS HUGEINT)) OVER (PARTITION BY subq_2.c1 ORDER BY subq_3.c1, subq_2.c6) AS HUGEINT)) AS c4, subq_3.c0 AS c5, 74 AS c6, subq_3.c0 AS c7 FROM (SELECT ref_0.uint AS c0, subq_1.c2 AS c1, subq_0.c2 AS c2, subq_1.c2 AS c3, ref_0.struct_of_fixed_array AS c4, subq_1.c0 AS c5, ref_0."interval" AS c6 FROM main.all_types AS ref_0 , (SELECT ref_0.timestamp_array AS c0, ref_0."struct" AS c1, ref_1."map" AS c2, ref_0.fixed_struct_array AS c3, ref_1.dec_18_6 AS c4, ref_0.uuid AS c5, ref_1.fixed_varchar_array AS c6, ref_0.time_tz AS c7 FROM main.all_types AS ref_1 WHERE (ref_1."varchar" ~~~ ref_1."varchar") LIMIT 76) AS subq_0 , (SELECT ref_2.usmallint AS c0, ref_2."bigint" AS c1, ref_0."interval" AS c2 FROM main.all_types AS ref_2 WHERE ((ref_0."varchar" ~~* ref_2."varchar") OR 1) LIMIT 93) AS subq_1 WHERE (ref_0."varchar" ~~* ref_0."varchar")) AS subq_2 , (SELECT ref_4.time_tz AS c0, ref_4.list_of_fixed_int_array AS c1 FROM main.all_types AS ref_3 LEFT JOIN main.all_types AS ref_4 ON (((ref_3."varchar" ^@ ref_4."varchar") OR 1)) WHERE (ref_4."varchar" !~~* ref_4."varchar")) AS subq_3 WHERE EXISTS(SELECT subq_2.c4 AS c0, ref_5.blob AS c1 FROM main.all_types AS ref_5 WHERE (ref_5.nested_int_array IS NULL)) LIMIT 86) AS subq_4 WHERE (EXISTS(SELECT NULL FROM main.all_types INNER JOIN main.all_types AS ref_7 INNER JOIN main.all_types AS ref_8 ON (NULL) INNER JOIN main.all_types AS ref_9 ON (NULL) INNER JOIN main.all_types AS ref_10 ON (NULL) ON (1) LEFT JOIN main.all_types AS ref_11 INNER JOIN main.all_types AS ref_12 INNER JOIN main.all_types AS ref_13 LEFT JOIN main.all_types AS ref_14 INNER JOIN main.all_types AS ref_15 ON (NULL) ON (NULL) ON (0) ON ((EXISTS(SELECT (SELECT "interval" FROM main.all_types LIMIT 1 OFFSET 1) AS c0, ref_16.date_array AS c1, ref_12.dec38_10 AS c2 FROM main.all_types AS ref_16 , (SELECT ref_11.timestamp_s AS c0, subq_4.c4 AS c1, ref_11.fixed_int_array AS c2, subq_4.c2 AS c3, ref_16.dec_18_6 AS c4, ref_13.timestamp_array AS c5, ref_11.double_array AS c6, ref_15.utinyint AS c7 FROM main.all_types AS ref_17 WHERE (subq_4.c1 IS NOT NULL)) AS subq_5 WHERE (EXISTS(SELECT ref_11.uhugeint AS c0, ref_14.struct_of_fixed_array AS c1 FROM main.all_types AS ref_18 WHERE ((ref_12."varchar" !~~ ref_16."varchar") AND 0) LIMIT 180) OR (ref_13.ubigint IS NOT NULL))) OR (ref_14."varchar" !~~ ref_13."varchar"))) ON ((ref_7.struct_of_arrays = ref_13.struct_of_arrays))) AND EXISTS(SELECT subq_7.c0 AS c0, subq_4.c2 AS c1, CASE  WHEN (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 2) ~~~ CAST(NULL AS VARCHAR))) THEN (subq_6.c0) ELSE subq_6.c0 END AS c2 FROM (SELECT subq_4.c6 AS c0, subq_4.c5 AS c1, subq_4.c4 AS c2, subq_4.c3 AS c3, ref_19.fixed_array_of_int_list AS c4, subq_4.c4 AS c5 FROM main.all_types AS ref_19 WHERE (subq_4.c3 IS NOT NULL) LIMIT 76) AS subq_6 , (SELECT (SELECT fixed_nested_varchar_array FROM main.all_types LIMIT 1 OFFSET 66) AS c0, subq_4.c4 AS c1 FROM main.all_types AS ref_20 WHERE 0 LIMIT 96) AS subq_7 WHERE EXISTS(SELECT subq_7.c1 AS c0, subq_4.c7 AS c1 FROM main.all_types AS ref_21 , (SELECT ref_22.fixed_nested_int_array AS c0, subq_7.c0 AS c1, (SELECT tinyint FROM main.all_types LIMIT 1 OFFSET 5) AS c2, subq_6.c4 AS c3, ref_21.fixed_nested_varchar_array AS c4, subq_6.c3 AS c5, subq_7.c1 AS c6, subq_4.c6 AS c7, 74 AS c8, ref_22.usmallint AS c9, subq_7.c0 AS c10, subq_6.c0 AS c11, ref_21."map" AS c12, subq_6.c4 AS c13 FROM main.all_types AS ref_22 WHERE ((ref_22."varchar" !~~* (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1)) OR 0 OR (ref_21."varchar" !~~* ref_22."varchar")) LIMIT 69) AS subq_8 , (SELECT ref_21.date_array AS c0, subq_7.c1 AS c1 FROM main.all_types AS ref_23 WHERE ((ref_21."varchar" ^@ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1)) AND (ref_21."varchar" ~~~ ref_23."varchar"))) AS subq_9 WHERE 0 LIMIT 36))) LIMIT 11

Error Message

ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "c3" [162.3] (bindings: {#[107.0], #[107.1], #[107.2], #[107.3], #[107.4], #[107.5], #[107.6], #[107.7]})