Skip to content

Commit 5d1a066

Browse files
committed
Fix findParents() in case of multiple levels to find.
By Andreas Seltenreich <andreas+pg@gate450.dyndns.org>
1 parent 0a5fdb0 commit 5d1a066

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/access/gin/ginbtree.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gin/ginbtree.c,v 1.1 2006/05/02 11:28:54 teodor Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gin/ginbtree.c,v 1.2 2006/05/26 08:01:17 teodor Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414

@@ -202,7 +202,7 @@ findParents( GinBtree btree, GinBtreeStack *stack,
202202
for(;;) {
203203
buffer = ReadBuffer(btree->index, blkno);
204204
LockBuffer(buffer, GIN_EXCLUSIVE);
205-
page = BufferGetPage(root->buffer);
205+
page = BufferGetPage(buffer);
206206
if ( GinPageIsLeaf(page) )
207207
elog(ERROR, "Lost path");
208208

@@ -224,6 +224,7 @@ findParents( GinBtree btree, GinBtreeStack *stack,
224224
ptr->blkno = blkno;
225225
ptr->buffer = buffer;
226226
ptr->parent = root; /* it's may be wrong, but in next call we will correct */
227+
ptr->off = offset;
227228
stack->parent = ptr;
228229
return;
229230
}

0 commit comments

Comments
 (0)