mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
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
This commit is contained in:
parent
b30a0c68da
commit
c2372420ee
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user