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,
202202for (;;) {
203203buffer = ReadBuffer (btree -> index ,blkno );
204204LockBuffer (buffer ,GIN_EXCLUSIVE );
205- page = BufferGetPage (root -> buffer );
205+ page = BufferGetPage (buffer );
206206if (GinPageIsLeaf (page ) )
207207elog (ERROR ,"Lost path" );
208208
@@ -224,6 +224,7 @@ findParents( GinBtree btree, GinBtreeStack *stack,
224224ptr -> blkno = blkno ;
225225ptr -> buffer = buffer ;
226226ptr -> parent = root ;/* it's may be wrong, but in next call we will correct */
227+ ptr -> off = offset ;
227228stack -> parent = ptr ;
228229return ;
229230}