summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-28 15:22:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-28 15:22:33 +0000
commita71a53079cb8c52210f901c303969c15dda25556 (patch)
tree18afbd2192561fb2ca724077cf14adc2977baaba /src/backend/access/gist/gist.c
parent6005c50fa681dc8d5dbc861410346cf7acce68ed (diff)
downloadpostgresql-a71a53079cb8c52210f901c303969c15dda25556.tar.gz
Repair error with not adjusting active scans properly after gistSplit.
Patch from Teodor Sigaev.
Diffstat (limited to 'src/backend/access/gist/gist.c')
-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 16105696d4..802690f80f 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.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,
/* 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;
@@ -1411,10 +1419,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);