Issue found by SQLSmith on git commit hash 50bb6 using seed 1061529599.
To Reproduce
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
SELECT (SELECT NULL) FROM (SELECT CASE WHEN (1) THEN ((SELECT utinyint FROM main.all_types LIMIT 1 OFFSET 2)) ELSE (SELECT utinyint FROM main.all_types LIMIT 1 OFFSET 2) END AS c0, ref_1.bool AS c1, ref_0."float" AS c2, ref_1.date AS c3, ref_1.timestamptz_array AS c4, ref_0.array_of_structs AS c5, ref_1.varchar_array AS c6, ref_1.uhugeint AS c7 FROM main.all_types AS ref_0 INNER JOIN main.all_types AS ref_1 ON ((ref_1."varchar" ^@ ref_1."varchar")) WHERE (icu_collate_id_id(CAST(ref_0."varchar" AS VARCHAR)) !~~* ref_0."varchar") LIMIT 39) AS subq_0 WHERE EXISTS(SELECT NULL FROM main.all_types AS ref_2 LEFT JOIN main.all_types ON (1) INNER JOIN main.all_types AS ref_4 ON ((SELECT NULL FROM main.all_types LIMIT 1 OFFSET 4)) WHERE EXISTS(SELECT (SELECT NULL) AS c0 WHERE (ref_2."varchar" AND 0 AND (ref_4."varchar" ~~* (SELECT "varchar" FROM main.all_types)))) LIMIT 104) LIMIT 44
Error Message
ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "varchar" [45.1] (bindings: {#[30.0], #[76.0]})
Issue found by SQLSmith on git commit hash 50bb6 using seed 1061529599.
To Reproduce
Error Message