Skip to content

Commit

Permalink
[fix](bitmap) fix coredump of bitmap_from_array caused by null array …
Browse files Browse the repository at this point in the history
…literal
  • Loading branch information
jacktengg committed Sep 15, 2023
1 parent 6b24871 commit 33d1c6e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions be/src/vec/functions/function_bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ class FunctionBitmapAlwaysNull : public IFunction {
if (check_column<ColumnInt8>(nested_column)) {
Impl::template vector<ColumnInt8>(offset_column_data, nested_column,
nested_null_map, res, null_map);
} else if (check_column<ColumnUInt8>(nested_column)) {
Impl::template vector<ColumnInt8>(offset_column_data, nested_column,
nested_null_map, res, null_map);
} else if (check_column<ColumnInt16>(nested_column)) {
Impl::template vector<ColumnInt16>(offset_column_data, nested_column,
nested_null_map, res, null_map);
Expand All @@ -301,6 +304,10 @@ class FunctionBitmapAlwaysNull : public IFunction {
} else if (check_column<ColumnInt64>(nested_column)) {
Impl::template vector<ColumnInt64>(offset_column_data, nested_column,
nested_null_map, res, null_map);
} else {
return Status::RuntimeError("Illegal column {} of argument of function {}",
block.get_by_position(arguments[0]).column->get_name(),
get_name());
}
} else {
return Status::RuntimeError("Illegal column {} of argument of function {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,6 @@ true
-- !sql_orthogonal_bitmap_intersect_count --
1 1

-- !sql --


Original file line number Diff line number Diff line change
Expand Up @@ -762,4 +762,7 @@ suite("test_bitmap_function") {
select count(distinct tag) as count1,
orthogonal_bitmap_intersect_count(id_bitmap, tag, 0) as count2_bitmap from test_orthog_bitmap_intersect;
"""

// BITMAP_FROM_ARRAY
qt_sql """ select bitmap_to_string(BITMAP_FROM_ARRAY([]));"""
}

0 comments on commit 33d1c6e

Please sign in to comment.