Cherry-picked from #53088 Co-authored-by: JinYang <130516674+gohalo@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
159975f237
commit
8869783458
@ -1908,7 +1908,12 @@ public:
|
||||
case BitmapTypeCode::BITMAP64_V2:
|
||||
_type = BITMAP;
|
||||
_is_shared = false;
|
||||
_bitmap = std::make_shared<detail::Roaring64Map>(detail::Roaring64Map::read(src));
|
||||
try {
|
||||
_bitmap = std::make_shared<detail::Roaring64Map>(detail::Roaring64Map::read(src));
|
||||
} catch (const std::runtime_error& e) {
|
||||
LOG(ERROR) << "Decode roaring bitmap failed, " << e.what();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case BitmapTypeCode::SET: {
|
||||
_type = SET;
|
||||
|
||||
@ -1188,4 +1188,10 @@ TEST(BitmapValueTest, bitmap_value_iterator_test) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST(BitmapValueTest, invalid_data) {
|
||||
BitmapValue bitmap;
|
||||
char data[] = {0x02, static_cast<char>(0xff), 0x03};
|
||||
EXPECT_FALSE(bitmap.deserialize(data));
|
||||
}
|
||||
} // namespace doris
|
||||
|
||||
Reference in New Issue
Block a user