Issue found by SQLSmith on git commit hash dd9e6 using seed 111047576.
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.int_array AS c7, ref_3."bigint" AS c10, ref_3.uint AS c20, ref_3.struct_of_fixed_array AS c21 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 ON (NULL) LEFT JOIN main.all_types AS ref_2 ON ((ref_1."double" = ref_2."double")) INNER JOIN main.all_types AS ref_3 ON ((ref_2."varchar" !~~* ref_2."varchar")) WHERE EXISTS(SELECT NULL FROM main.all_types , (SELECT ref_1."float" AS c0 WHERE 0) WHERE (ref_2."varchar" OR NULL OR NULL OR ref_3."varchar"))) INNER JOIN (SELECT (SELECT "double" FROM main.all_types LIMIT 1 OFFSET 92) AS c0, ref_6."double" AS c1, ref_6.date AS c2, ref_6."union" AS c3, ref_6.timestamptz_array AS c4, ref_6.nested_int_array AS c5, ref_6.fixed_struct_array AS c6, ref_6."float" AS c7, ref_6.usmallint AS c8, (SELECT timestamptz_array FROM main.all_types LIMIT 1 OFFSET 5) AS c9 FROM main.all_types AS ref_6 WHERE 0 LIMIT 50) AS subq_2 ON ((subq_2.c4 IS NULL)) RIGHT JOIN main.all_types AS ref_7 ON ((CASE WHEN ((ref_7.fixed_array_of_int_list IS NULL)) THEN (ref_7."varchar") ELSE ref_7."varchar" END !~~* ref_7."varchar")) LIMIT 128
Error Message
ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "varchar" [18.2] (bindings: {#[3.0], #[3.1], #[3.2], #[3.3], #[3.4]})
Issue found by SQLSmith on git commit hash dd9e6 using seed 111047576.
To Reproduce
Error Message