mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
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.
This commit is contained in:
@ -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)))
|
||||
|
Reference in New Issue
Block a user