mirror of https://github.com/milvus-io/milvus.git
fix: Fix using wrong upperbound when searching by pk (#37769)
issue: https://github.com/milvus-io/milvus/issues/37649 Signed-off-by: sunby <sunbingyi1992@gmail.com>pull/37794/head
parent
fceff6ed7f
commit
6b82320953
|
@ -1239,8 +1239,7 @@ ChunkedSegmentSealedImpl::search_sorted_pk(const PkType& pk,
|
|||
return elem < value;
|
||||
});
|
||||
auto num_rows_until_chunk = pk_column->GetNumRowsUntilChunk(i);
|
||||
for (; it != src + pk_column->NumRows() && *it == target;
|
||||
++it) {
|
||||
for (; it != src + chunk_row_num && *it == target; ++it) {
|
||||
auto offset = it - src + num_rows_until_chunk;
|
||||
if (condition(offset)) {
|
||||
pk_offsets.emplace_back(offset);
|
||||
|
@ -1264,7 +1263,7 @@ ChunkedSegmentSealedImpl::search_sorted_pk(const PkType& pk,
|
|||
auto string_chunk = std::dynamic_pointer_cast<StringChunk>(
|
||||
var_column->GetChunk(i));
|
||||
auto offset = string_chunk->binary_search_string(target);
|
||||
for (; offset != -1 && offset < var_column->NumRows() &&
|
||||
for (; offset != -1 && offset < string_chunk->RowNums() &&
|
||||
var_column->RawAt(offset) == target;
|
||||
++offset) {
|
||||
auto segment_offset = offset + num_rows_until_chunk;
|
||||
|
|
|
@ -180,7 +180,7 @@ class TestChunkSegment : public testing::Test {
|
|||
-1,
|
||||
segcore::SegcoreConfig::default_config(),
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true);
|
||||
test_data_count = 10000;
|
||||
|
||||
|
|
Loading…
Reference in New Issue