Issue found by SQLSmith on git commit hash 50bb6 using seed 569910251.
To Reproduce
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
SELECT (SELECT NULL) AS c0, (SELECT NULL) AS c3 FROM (SELECT ref_1.date_array AS c1 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 INNER JOIN main.all_types AS ref_2 LEFT JOIN main.all_types AS ref_3 ON ((ref_2."float" = ref_3."float")) ON ((ref_2.struct_of_fixed_array IS NULL)) ON (((SELECT timestamp_s FROM main.all_types LIMIT 1 OFFSET 4) IS NOT NULL)) WHERE EXISTS(SELECT NULL, NULL, ref_1.dec_9_4 AS c2, ref_0."varchar" AS c3 WHERE (NULL ~~~ (SELECT NULL LIMIT 1 OFFSET 1)) LIMIT 107)) INNER JOIN (SELECT ref_5.time_tz AS c0, ref_5."float" AS c1, ref_5.dec_18_6 AS c2, ref_5.timestamp_array AS c3, ref_5."struct" AS c4, ref_5.blob AS c5, ref_5.list_of_fixed_int_array AS c6, ref_5.date_array AS c7, ref_5.int_array AS c8 FROM main.all_types AS ref_5 WHERE (ref_5."varchar" ~~* ref_5."varchar") LIMIT 37) AS subq_1 ON ((((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 31) ~~* CASE WHEN (((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 5) ^@ (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3))) THEN ((SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3)) ELSE (SELECT "varchar" FROM main.all_types LIMIT 1 OFFSET 3) END) OR (current_database() ~~ CAST(NULL AS VARCHAR))))
Error Message
ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "c3" [18.5] (bindings: {#[1.0], #[1.1], #[2.0], #[2.1], #[3.0], #[93.0]})
Issue found by SQLSmith on git commit hash 50bb6 using seed 569910251.
To Reproduce
Error Message