Skip to content

Commit 8ef37ad

Browse files
committed
MDEV-35745 Assertion failure, ASAN errors, crash in mhnsw_read_first/mhnsw_read_next
If the table has many deleted nodes, they can overflow `candidates` even when `best` isn't full yet
1 parent 0eaefaf commit 8ef37ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/vector_mhnsw.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ static int search_layer(MHNSW_Share *ctx, TABLE *graph, const FVector *target,
10921092
if (!best.is_full())
10931093
{
10941094
max_distance= std::max(max_distance, v->distance_to_target);
1095-
candidates.push(v);
1095+
candidates.safe_push(v);
10961096
if (skip_deleted && v->node->deleted)
10971097
continue;
10981098
best.push(v);

0 commit comments

Comments
 (0)