From c03ce7d62a0c3ebbcd6214984ed17fe715e01ced Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 10 Jun 2023 11:29:47 -0700 Subject: [PATCH] Ensure insert page is always set --- src/ivfinsert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ivfinsert.c b/src/ivfinsert.c index 8d87267..752ce55 100644 --- a/src/ivfinsert.c +++ b/src/ivfinsert.c @@ -39,7 +39,7 @@ FindInsertPage(Relation rel, Datum *values, BlockNumber *insertPage, ListInfo * list = (IvfflatList) PageGetItem(cpage, PageGetItemId(cpage, offno)); distance = DatumGetFloat8(FunctionCall2Coll(procinfo, collation, values[0], PointerGetDatum(&list->center))); - if (distance < minDistance) + if (distance < minDistance || !BlockNumberIsValid(*insertPage)) { *insertPage = list->insertPage; listInfo->blkno = nextblkno;