Issue found by SQLSmith on git commit hash dd9e6 using seed 697797495.
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 (SELECT dec38_10 FROM main.all_types LIMIT 1 OFFSET 2) AS c0, ref_1.tinyint AS c1, CASE WHEN ((ref_2."varchar" !~~* ref_3."varchar")) THEN (ref_0."double") ELSE ref_0."double" END AS c6, 31 AS c7, ref_3.dec_18_6 AS c8, ref_1.bool AS c9 FROM main.all_types AS ref_0 RIGHT JOIN main.all_types AS ref_1 INNER JOIN main.all_types AS ref_2 ON (1) ON ((ref_0."double" IS NULL)) INNER JOIN main.all_types AS ref_3 ON (((ref_2."varchar" !~~ ref_3."varchar") AND (CAST(NULL AS VARCHAR) !~~ ref_2."varchar"))) INNER JOIN main.all_types AS ref_4 ON ((ref_1.uint IS NULL)) INNER JOIN main.all_types AS ref_5 ON ((ref_3.uhugeint = ref_5.uhugeint)) , (SELECT (SELECT timestamp_s FROM main.all_types LIMIT 1 OFFSET 3) AS c0, ref_4.time_tz AS c1, ref_0.timestamp_ms AS c2, ref_5.utinyint AS c3, ref_2."smallint" AS c4, ref_5."float" AS c5, ref_1."interval" AS c6, ref_5.timestamp_array AS c7, ref_3.timestamptz_array AS c8, ref_1.utinyint AS c9, ref_0.struct_of_fixed_array AS c10 FROM main.all_types AS ref_6 WHERE ((ref_1."varchar" ~~~ ref_4."varchar") OR ((0 OR (ref_0."varchar" ^@ ref_3."varchar")) AND 1 AND EXISTS(SELECT ref_6.time_tz AS c0, ref_2.fixed_nested_int_array AS c1, ref_5.hugeint AS c2 FROM main.all_types AS ref_7 WHERE ((ref_3.time_tz IS NULL) AND EXISTS(SELECT ref_3.timestamp_ms AS c0, ref_3.timestamp_ns AS c1, ref_8."time" AS c2 FROM main.all_types AS ref_8 WHERE EXISTS(SELECT (SELECT usmallint FROM main.all_types LIMIT 1 OFFSET 2) AS c0, (SELECT "bigint" FROM main.all_types LIMIT 1 OFFSET 1) AS c1 FROM main.all_types AS ref_9 , (SELECT subq_0.c4 AS c0 FROM main.all_types AS ref_10 , (SELECT ref_6."timestamp" AS c0, ref_9.double_array AS c1, ref_0."timestamp" AS c2, (SELECT fixed_varchar_array FROM main.all_types LIMIT 1 OFFSET 6) AS c3, ref_5."double" AS c4, ref_11.timestamp_array AS c5, ref_10.fixed_int_array AS c6 FROM main.all_types AS ref_11 WHERE (ref_2."varchar" ~~ ref_7."varchar")) AS subq_0 WHERE 0) AS subq_1 , (SELECT (SELECT list_of_fixed_int_array FROM main.all_types LIMIT 1 OFFSET 6) AS c0 FROM main.all_types AS ref_12 WHERE (0 OR 0 OR ((ref_12."varchar" ~~ ref_8."varchar") AND (ref_6."varchar" ~~* ref_0."varchar")))) AS subq_2 , (SELECT ref_2.fixed_nested_int_array AS c0, ref_3.fixed_struct_array AS c1, ref_4.dec_18_6 AS c2, ref_9.hugeint AS c3 FROM main.all_types AS ref_13 WHERE 0 LIMIT 79) AS subq_3 WHERE 0 LIMIT 34))) LIMIT 118)) OR 0)) AS subq_4 WHERE (ref_5."varchar" !~~* ref_4."varchar") LIMIT 87) AS subq_5 , (SELECT (SELECT time_tz FROM main.all_types LIMIT 1 OFFSET 4) AS c0, subq_5.c6 AS c1, ref_14."interval" AS c2, (SELECT fixed_int_array FROM main.all_types LIMIT 1 OFFSET 79) AS c3, ref_14.timestamp_ms AS c4, ref_14.ubigint AS c5, ref_14.list_of_fixed_int_array AS c6 FROM main.all_types AS ref_14 WHERE (subq_5.c1 IS NULL) LIMIT 190) AS subq_6 WHERE ((SELECT NULL) OR ((SELECT NULL) !~~* (SELECT NULL))) LIMIT 120
Issue found by SQLSmith on git commit hash dd9e6 using seed 697797495.
To Reproduce
Error Message