summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-03-07 21:20:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-03-07 21:20:26 +0000
commitb109b03feaec96aab6c635137b5a668389df8d31 (patch)
treeabdfa61d10ad947475abdf136662fb5d3900ac02 /src/backend/access/gist/gist.c
parent296c806dd5a44bdbca6f78600a3cc68ecd89161b (diff)
downloadpostgresql-b109b03feaec96aab6c635137b5a668389df8d31.tar.gz
Repair a number of places that didn't bother to check whether PageAddItem
succeeds or not. Revise rtree page split algorithm to take care about making a feasible split --- ie, will the incoming tuple actually fit? Failure to make a feasible split, combined with failure to notice the failure, account for Jim Stone's recent bug report. I suspect that hash and gist indices may have the same type of bug, but at least now we'll get error messages rather than silent failures if so. Also clean up rtree code to use Datum rather than char* where appropriate.
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r--src/backend/access/gist/gist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index c7bfa9c962..9e3f935bd6 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.70 2001/02/22 21:48:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.71 2001/03/07 21:20:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -395,6 +395,9 @@ gistPageAddItem(GISTSTATE *giststate,
*newtup = gist_tuple_replacekey(r, tmpcentry, itup);
retval = PageAddItem(page, (Item) *newtup, IndexTupleSize(*newtup),
offsetNumber, flags);
+ if (retval == InvalidOffsetNumber)
+ elog(ERROR, "gist: failed to add index item to %s",
+ RelationGetRelationName(r));
/* be tidy */
if (tmpcentry.pred && tmpcentry.pred != dentry->pred
&& tmpcentry.pred != (((char *) itup) + sizeof(IndexTupleData)))