Skip to content
Snippets Groups Projects
Commit a71a5307 authored by Tom Lane's avatar Tom Lane
Browse files

Repair error with not adjusting active scans properly after gistSplit.

Patch from Teodor Sigaev.
parent 6005c50f
No related branches found
No related tags found
No related merge requests found
...@@ -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
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.93 2002/05/24 18:57:55 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.94 2002/05/28 15:22:33 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -494,6 +494,14 @@ gistlayerinsert(Relation r, BlockNumber blkno, ...@@ -494,6 +494,14 @@ gistlayerinsert(Relation r, BlockNumber blkno,
/* key is modified, so old version must be deleted */ /* key is modified, so old version must be deleted */
ItemPointerSet(&oldtid, blkno, child); ItemPointerSet(&oldtid, blkno, child);
gistdelete(r, &oldtid); gistdelete(r, &oldtid);
/*
* if child was splitted, new key for child will be inserted
* in the end list of child, so we must say to any scans
* that page is changed beginning from 'child' offset
*/
if ( ret & SPLITED )
gistadjscans(r, GISTOP_SPLIT, blkno, child);
} }
ret = INSERTED; ret = INSERTED;
...@@ -1411,10 +1419,6 @@ gistSplit(Relation r, ...@@ -1411,10 +1419,6 @@ gistSplit(Relation r,
ItemPointerSet(&(newtup[nlen - 1]->t_tid), lbknum, 1); ItemPointerSet(&(newtup[nlen - 1]->t_tid), lbknum, 1);
} }
/* adjust active scans */
gistadjscans(r, GISTOP_SPLIT, BufferGetBlockNumber(buffer), FirstOffsetNumber);
/* !!! pfree */ /* !!! pfree */
pfree(rvectup); pfree(rvectup);
pfree(lvectup); pfree(lvectup);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment