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" [22.7] (bindings: {#[9.0], #[10.0], #[10.1], #[11.0], #[267.0], #[19.0], #[19.1]}) #3167

Closed fuzzerofducks closed 3 months ago

fuzzerofducks commented 3 months ago

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

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_3.dec_18_6 AS c0 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 ON (((ref_0."varchar" ~~ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1)) OR (CAST(NULL AS VARCHAR) ^@ ref_1."varchar") OR (ref_0."time" IS NULL))) INNER JOIN main.all_types AS ref_2 LEFT JOIN main.all_types AS ref_3 ON (((ref_3.fixed_int_array IS NULL) AND (ref_2."varchar" !~~ ref_2."varchar"))) INNER JOIN main.all_types AS ref_4 ON (((SELECT varchar_array FROM main.all_types LIMIT 1 OFFSET 6) IS NULL)) LEFT JOIN main.all_types AS ref_5 ON ((ref_2."varchar" ~~~ ref_4."varchar")) ON (1) RIGHT JOIN main.all_types AS ref_6 ON (EXISTS(SELECT ref_5.usmallint AS c0, ref_5.hugeint AS c1, ref_7."bigint" AS c2, ref_0.tinyint AS c3, ref_7."float" AS c4 FROM main.all_types AS ref_7 WHERE 0 LIMIT 77)) WHERE (ref_4."varchar" !~~ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 6))) AS subq_0 WHERE ((CASE  WHEN (((CASE  WHEN ((((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 5) !~~* (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 5)) AND ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 2) ~~~ CAST(NULL AS VARCHAR)))) THEN (CAST(NULL AS VARCHAR)) ELSE CAST(NULL AS VARCHAR) END ~~~ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 4)) AND ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 2) ~~* CASE  WHEN (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 6) ^@ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1))) THEN ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 5)) ELSE (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 5) END))) THEN (CASE  WHEN (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3) ~~~ CAST(NULL AS VARCHAR))) THEN ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 5)) ELSE (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 5) END) ELSE CASE  WHEN ((SELECT NULL LIMIT 1 OFFSET 3)) THEN ((SELECT NULL)) ELSE (SELECT NULL) END END ~~~ CASE  WHEN ((subq_0.c0 IS NULL)) THEN ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1)) ELSE (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 1) END) AND 1 AND EXISTS(SELECT ref_8.fixed_nested_varchar_array AS c0, ref_8.fixed_int_array AS c1, subq_0.c0 AS c2, subq_0.c0 AS c3 FROM main.all_types AS ref_8 , (SELECT (SELECT "smallint" FROM main.all_types LIMIT 1 OFFSET 4) AS c0, ref_8.fixed_nested_varchar_array AS c1, subq_0.c0 AS c2, ref_9.fixed_nested_varchar_array AS c3, (SELECT "double" FROM main.all_types LIMIT 1 OFFSET 2) AS c4, (SELECT "bit" FROM main.all_types LIMIT 1 OFFSET 5) AS c5, 41 AS c6, ref_8.nested_int_array AS c7, subq_0.c0 AS c8, ref_8.struct_of_fixed_array AS c9, subq_0.c0 AS c10, (SELECT ubigint FROM main.all_types LIMIT 1 OFFSET 3) AS c11, ref_8.timestamp_s AS c12, ref_8."bigint" AS c13 FROM main.all_types AS ref_9 WHERE (EXISTS(SELECT subq_0.c0 AS c0, ref_8.timestamp_ms AS c1, ref_9."varchar" AS c2, (SELECT "double" FROM main.all_types LIMIT 1 OFFSET 5) AS c3, ref_8."interval" AS c4, ref_9."float" AS c5, subq_0.c0 AS c6, ref_8.fixed_int_array AS c7, ref_9.dec_18_6 AS c8, subq_0.c0 AS c9, ref_8."varchar" AS c10, ref_8.timestamp_ns AS c11, ref_9.uint AS c12, (SELECT "timestamp" FROM main.all_types LIMIT 1 OFFSET 6) AS c13, subq_0.c0 AS c14 FROM main.all_types AS ref_10 WHERE 1 LIMIT 13) OR ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 4) ~~ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3)) OR (ref_8."varchar" !~~* ref_9."varchar"))) AS subq_1 , (SELECT ref_11."bit" AS c0, subq_1.c8 AS c1, subq_0.c0 AS c2, subq_0.c0 AS c3, subq_0.c0 AS c4 FROM main.all_types AS ref_11 WHERE (ref_11."varchar" ^@ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3)) LIMIT 67) AS subq_2 WHERE EXISTS(SELECT subq_2.c3 AS c0, subq_0.c0 AS c1, ref_12.blob AS c2 FROM main.all_types AS ref_12 RIGHT JOIN main.all_types AS ref_13 ON (0) WHERE (ref_12."varchar" !~~* ref_12."varchar") LIMIT 27) LIMIT 159))

Error Message

ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "c3" [22.7] (bindings: {#[9.0], #[10.0], #[10.1], #[11.0], #[267.0], #[19.0], #[19.1]})