Commit 5d1a066e authored by Teodor Sigaev's avatar Teodor Sigaev

Fix findParents() in case of multiple levels to find.

By Andreas Seltenreich <andreas+pg@gate450.dyndns.org>
parent 0a5fdb0d
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gin/ginbtree.c,v 1.1 2006/05/02 11:28:54 teodor Exp $ * $PostgreSQL: pgsql/src/backend/access/gin/ginbtree.c,v 1.2 2006/05/26 08:01:17 teodor Exp $
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -202,7 +202,7 @@ findParents( GinBtree btree, GinBtreeStack *stack, ...@@ -202,7 +202,7 @@ findParents( GinBtree btree, GinBtreeStack *stack,
for(;;) { for(;;) {
buffer = ReadBuffer(btree->index, blkno); buffer = ReadBuffer(btree->index, blkno);
LockBuffer(buffer, GIN_EXCLUSIVE); LockBuffer(buffer, GIN_EXCLUSIVE);
page = BufferGetPage(root->buffer); page = BufferGetPage(buffer);
if ( GinPageIsLeaf(page) ) if ( GinPageIsLeaf(page) )
elog(ERROR, "Lost path"); elog(ERROR, "Lost path");
...@@ -224,6 +224,7 @@ findParents( GinBtree btree, GinBtreeStack *stack, ...@@ -224,6 +224,7 @@ findParents( GinBtree btree, GinBtreeStack *stack,
ptr->blkno = blkno; ptr->blkno = blkno;
ptr->buffer = buffer; ptr->buffer = buffer;
ptr->parent = root; /* it's may be wrong, but in next call we will correct */ ptr->parent = root; /* it's may be wrong, but in next call we will correct */
ptr->off = offset;
stack->parent = ptr; stack->parent = ptr;
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment