Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1f5a92

Browse files
committed
Fix two small bugs in new gistget.c logic.
1. Complain, rather than silently doing nothing, if an "invalid" tupleis found on a leaf page. Per off-list discussion with Heikki.2. Fix oversight in code that removes a GISTSearchItem from the searchqueue: we have to reset lastHeap if this was the last heap item in theparent GISTSearchTreeItem. Otherwise subsequent additions will do thewrong thing. This was probably masked in early testing because in typicalcases the parent item would now be completely empty and would be deleted onnext call. You'd need a queued non-leaf page at exactly the same distanceas a heap tuple to expose the bug.
1 parent387e468 commitd1f5a92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/access/gist/gistget.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ gistindex_keytest(IndexScanDesc scan,
7070
{
7171
inti;
7272

73+
if (GistPageIsLeaf(page))/* shouldn't happen */
74+
elog(ERROR,"invalid GIST tuple found on leaf page");
7375
for (i=0;i<scan->numberOfOrderBys;i++)
7476
so->distances[i]=-get_float8_infinity();
75-
*recheck_p= true;/* probably unnecessary */
7677
return true;
7778
}
7879

@@ -403,6 +404,8 @@ getNextGISTSearchItem(GISTScanOpaque so)
403404
{
404405
/* Delink item from chain */
405406
so->curTreeItem->head=item->next;
407+
if (item==so->curTreeItem->lastHeap)
408+
so->curTreeItem->lastHeap=NULL;
406409
/* Return item; caller is responsible to pfree it */
407410
returnitem;
408411
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp