[Bug][vec] Fix bug of nullable const value convert to argument cause coredump (#8139)

Co-authored-by: lihaopeng <lihaopeng@baidu.com>
This commit is contained in:
HappenLee
2022-02-20 20:05:23 +08:00
committed by GitHub
parent 13d217b947
commit 56adc7f56b
4 changed files with 34 additions and 8 deletions

View File

@ -54,9 +54,12 @@ public:
for (int i = 0; i < 3; ++i) {
argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const();
if (auto* nullable = check_and_get_column<ColumnNullable>(*argument_columns[i])) {
argument_columns[i] = nullable->get_nested_column_ptr();
// Danger: Here must dispose the null map data first! Because
// argument_columns[i]=nullable->get_nested_column_ptr(); will release the mem
// of column nullable mem of null map
VectorizedUtils::update_null_map(result_null_map_column->get_data(),
nullable->get_null_map_data());
argument_columns[i] = nullable->get_nested_column_ptr();
}
}