aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-28 15:22:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-28 15:22:44 +0000
commit5b792153fc42d7986d7a8bd53daab268a2320663 (patch)
treea9141e85355571699e9b11197b760851c72ad5ec /src
parent63448825fb041704554849cbfac00f022540936f (diff)
downloadpostgresql-5b792153fc42d7986d7a8bd53daab268a2320663.tar.gz
postgresql-5b792153fc42d7986d7a8bd53daab268a2320663.zip
Repair error with not adjusting active scans properly after gistSplit.
Patch from Teodor Sigaev.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/gist/gist.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index 1ce1914304b..c07d1f5652f 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.88 2002/02/11 22:41:59 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.88.2.1 2002/05/28 15:22:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -496,6 +496,14 @@ gistlayerinsert(Relation r, BlockNumber blkno,
/* key is modified, so old version must be deleted */
ItemPointerSet(&oldtid, blkno, child);
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;
@@ -1413,10 +1421,6 @@ gistSplit(Relation r,
ItemPointerSet(&(newtup[nlen - 1]->t_tid), lbknum, 1);
}
-
- /* adjust active scans */
- gistadjscans(r, GISTOP_SPLIT, BufferGetBlockNumber(buffer), FirstOffsetNumber);
-
/* !!! pfree */
pfree(rvectup);
pfree(lvectup);