Issue found by SQLSmith on git commit hash 50bb6 using seed 92576570.
To Reproduce
create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types() limit 0;
SELECT mod((SELECT NULL), (SELECT NULL)) AS c1, (SELECT NULL) AS c4 FROM (SELECT NULL FROM (SELECT ref_0.uuid AS c0, 68 AS c1, ref_0.fixed_varchar_array AS c2, 2 AS c3, 34 AS c4, ref_0.fixed_nested_int_array AS c5, ref_0.fixed_nested_int_array AS c6, ref_0."struct" AS c7 FROM main.all_types AS ref_0 WHERE (ref_0."varchar" ~~* ref_0."varchar")) AS subq_0 WHERE EXISTS(SELECT ref_1."float" AS c0, 81 AS c1, (SELECT date FROM main.all_types LIMIT 1 OFFSET 6) AS c2, ref_1.nested_int_array AS c3, (SELECT nested_int_array FROM main.all_types LIMIT 1 OFFSET 4) AS c4, subq_0.c3 AS c5, subq_0.c1 AS c6, subq_0.c6 AS c7 FROM main.all_types AS ref_1 WHERE EXISTS(SELECT subq_0.c0 AS c0 FROM main.all_types AS ref_2 WHERE ((ref_1."varchar" ~~ ref_1."varchar") AND (ref_2."varchar" !~~* CAST(NULL AS VARCHAR)) AND (ref_1.dec_9_4 IS NOT NULL)) LIMIT 168) LIMIT 116)) WHERE CASE WHEN (NULL) THEN ((SELECT NULL)) ELSE (SELECT NULL) END LIMIT 139
Error Message
ABORT THROWN BY INTERNAL EXCEPTION: Failed to bind column reference "varchar" [21.1] (bindings: {#[87.0], #[87.1], #[87.2], #[87.3], #[82.0], #[84.0]})
Issue found by SQLSmith on git commit hash 50bb6 using seed 92576570.
To Reproduce
Error Message