提交 c2372420 编写于 作者: A Azat Khuzhin

Add type conversion for StorageJoin (previously led to SIGSEGV)

Found with fuzzer under UBsan [1]:

  [1]: https://clickhouse-test-reports.s3.yandex.net/21579/61d40c3600ba6a1c6d6c0cf4919a3cdaebb3a31f/fuzzer_ubsan/report.html#fail1
上级 b30a0c68
......@@ -854,6 +854,13 @@ JoinPtr SelectQueryExpressionAnalyzer::makeTableJoin(
return join;
}
}
else
{
const ColumnsWithTypeAndName & right_sample_columns = subquery_for_join.sample_block.getColumnsWithTypeAndName();
bool need_convert = syntax->analyzed_join->applyJoinKeyConvert(left_sample_columns, right_sample_columns);
if (need_convert)
subquery_for_join.addJoinActions(std::make_shared<ExpressionActions>(syntax->analyzed_join->rightConvertingActions()));
}
return subquery_for_join.join;
}
......
......@@ -2,3 +2,4 @@
2 22 92 82 123457
1 11 91 81 123456
2 22 92 82 123457
11 1 91 81 123456
......@@ -36,5 +36,13 @@ from (
) js1
SEMI LEFT JOIN joinbug_join using id2;
/* type conversion */
SELECT * FROM
(
SELECT toUInt32(11) AS id2
) AS js1
SEMI LEFT JOIN joinbug_join USING (id2);
DROP TABLE joinbug;
DROP TABLE joinbug_join;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册