Fix assert cast in join on falsy condition

This commit is contained in:
vdimir 2022-10-17 16:12:00 +00:00
parent cf6442fa65
commit 597544a15b
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
3 changed files with 19 additions and 0 deletions

View File

@ -232,6 +232,11 @@ HashJoin::HashJoin(std::shared_ptr<TableJoin> table_join_, const Block & right_s
data->type = Type::CROSS;
sample_block_with_columns_to_add = right_sample_block;
}
else if (table_join->getClauses().empty())
{
data->type = Type::EMPTY;
sample_block_with_columns_to_add = right_sample_block;
}
else if (table_join->oneDisjunct())
{
const auto & key_names_right = table_join->getOnlyClause().key_names_right;

View File

@ -0,0 +1,2 @@
1 0
\N 1

View File

@ -0,0 +1,12 @@
DROP TABLE IF EXISTS t1__fuzz_13;
DROP TABLE IF EXISTS t2__fuzz_47;
SET allow_suspicious_low_cardinality_types = 1;
CREATE TABLE t1__fuzz_13 (id Nullable(Int16)) ENGINE = MergeTree() ORDER BY id SETTINGS allow_nullable_key = 1;
CREATE TABLE t2__fuzz_47 (id LowCardinality(Int16)) ENGINE = MergeTree() ORDER BY id;
INSERT INTO t1__fuzz_13 VALUES (1);
INSERT INTO t2__fuzz_47 VALUES (1);
SELECT * FROM t1__fuzz_13 FULL OUTER JOIN t2__fuzz_47 ON 1 = 2;