From 6e8239d5d45934dbd090a4db5750bc947d500129 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 14 Jun 2021 07:21:29 +0300 Subject: [PATCH] Add a test for #20315 --- .../01912_bad_cast_join_fuzz.reference | 10 ++++++++++ .../0_stateless/01912_bad_cast_join_fuzz.sql | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/queries/0_stateless/01912_bad_cast_join_fuzz.reference create mode 100644 tests/queries/0_stateless/01912_bad_cast_join_fuzz.sql diff --git a/tests/queries/0_stateless/01912_bad_cast_join_fuzz.reference b/tests/queries/0_stateless/01912_bad_cast_join_fuzz.reference new file mode 100644 index 00000000000..68707e5a4a7 --- /dev/null +++ b/tests/queries/0_stateless/01912_bad_cast_join_fuzz.reference @@ -0,0 +1,10 @@ +1023 0 \N +1024 1 \N +1025 2 \N +1026 3 \N +1027 4 \N +1028 5 \N +1029 6 \N +1030 7 \N +1031 8 \N +1032 9 \N diff --git a/tests/queries/0_stateless/01912_bad_cast_join_fuzz.sql b/tests/queries/0_stateless/01912_bad_cast_join_fuzz.sql new file mode 100644 index 00000000000..01e02a3be62 --- /dev/null +++ b/tests/queries/0_stateless/01912_bad_cast_join_fuzz.sql @@ -0,0 +1,16 @@ +SELECT + 1023 + l, + * +FROM +( + SELECT toLowCardinality(toNullable(number)) AS l + FROM system.numbers + LIMIT 10 +) AS s1 +ANY LEFT JOIN +( + SELECT toLowCardinality(toNullable(number)) AS r + FROM system.numbers + LIMIT 7 +) AS s2 ON (l + 1023) = (r * 3) +ORDER BY l, r;