fix:fix term expr overflow bug (#36534)

pr: #36525

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
pull/36588/head
zhagnlu 2024-09-28 17:43:16 +08:00 committed by GitHub
parent 6335c8bf69
commit 9a07c1bca9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 6 deletions

View File

@ -492,14 +492,12 @@ PhyTermFilterExpr::ExecVisitorImplForIndex() {
std::vector<IndexInnerType> vals;
for (auto& val : expr_->vals_) {
auto converted_val = GetValueFromProto<T>(val);
// Integral overflow process
if constexpr (std::is_integral_v<T>) {
if (milvus::query::out_of_range<T>(converted_val)) {
continue;
}
bool overflowed = false;
auto converted_val = GetValueFromProtoWithOverflow<T>(val, overflowed);
if (!overflowed) {
vals.emplace_back(converted_val);
}
vals.emplace_back(converted_val);
}
auto execute_sub_batch = [](Index* index_ptr,
const std::vector<IndexInnerType>& vals) {