diff --git a/be/src/vec/functions/function_conv.cpp b/be/src/vec/functions/function_conv.cpp index ae88f68a04..1385603ec0 100644 --- a/be/src/vec/functions/function_conv.cpp +++ b/be/src/vec/functions/function_conv.cpp @@ -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(*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(); } } diff --git a/be/src/vec/functions/function_convert_tz.h b/be/src/vec/functions/function_convert_tz.h index 739279d5f3..6666729208 100644 --- a/be/src/vec/functions/function_convert_tz.h +++ b/be/src/vec/functions/function_convert_tz.h @@ -54,9 +54,12 @@ public: argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); if (auto* nullable = check_and_get_column(*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(); } } diff --git a/be/src/vec/functions/function_string.h b/be/src/vec/functions/function_string.h index 934053e107..c14e639c57 100644 --- a/be/src/vec/functions/function_string.h +++ b/be/src/vec/functions/function_string.h @@ -127,9 +127,12 @@ struct SubstringUtil { argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); if (auto* nullable = check_and_get_column(*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(null_map->get_data(), nullable->get_null_map_data()); + argument_columns[i] = nullable->get_nested_column_ptr(); } } @@ -521,13 +524,18 @@ public: std::vector null_list(argument_size); ColumnPtr argument_columns[argument_size]; + ColumnPtr argument_null_columns[argument_size]; for (size_t i = 0; i < argument_size; ++i) { argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); if (auto* nullable = check_and_get_column(*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 null_list[i] = &nullable->get_null_map_data(); + argument_null_columns[i] = nullable->get_null_map_column_ptr(); + argument_columns[i] = nullable->get_nested_column_ptr(); } else { null_list[i] = &const_null_map->get_data(); } @@ -670,9 +678,12 @@ public: argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); if (auto* nullable = check_and_get_column(*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(null_map->get_data(), nullable->get_null_map_data()); + argument_columns[i] = nullable->get_nested_column_ptr(); } } @@ -817,9 +828,12 @@ public: argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); if (auto* nullable = check_and_get_column(*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(null_map->get_data(), nullable->get_null_map_data()); + argument_columns[i] = nullable->get_nested_column_ptr(); } } diff --git a/be/src/vec/functions/function_totype.h b/be/src/vec/functions/function_totype.h index fef300e6cf..425a09b3fe 100644 --- a/be/src/vec/functions/function_totype.h +++ b/be/src/vec/functions/function_totype.h @@ -291,9 +291,12 @@ public: argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); if (auto* nullable = check_and_get_column(*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(null_map->get_data(), nullable->get_null_map_data()); + argument_columns[i] = nullable->get_nested_column_ptr(); } } @@ -356,9 +359,12 @@ public: argument_columns[i] = block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); if (auto* nullable = check_and_get_column(*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(null_map->get_data(), nullable->get_null_map_data()); + argument_columns[i] = nullable->get_nested_column_ptr(); } }