From b109b03feaec96aab6c635137b5a668389df8d31 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 7 Mar 2001 21:20:26 +0000 Subject: 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. --- src/backend/access/gist/gist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/backend/access/gist/gist.c') 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))) -- cgit v1.2.1