diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-07 21:20:26 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-07 21:20:26 +0000 |
commit | b109b03feaec96aab6c635137b5a668389df8d31 (patch) | |
tree | abdfa61d10ad947475abdf136662fb5d3900ac02 /src/backend/commands/sequence.c | |
parent | 296c806dd5a44bdbca6f78600a3cc68ecd89161b (diff) | |
download | postgresql-b109b03feaec96aab6c635137b5a668389df8d31.tar.gz postgresql-b109b03feaec96aab6c635137b5a668389df8d31.zip |
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/commands/sequence.c')
-rw-r--r-- | src/backend/commands/sequence.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 5ad9a87f591..04398423b67 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.50 2001/02/13 01:57:12 pjw Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.51 2001/03/07 21:20:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -785,7 +785,8 @@ void seq_redo(XLogRecPtr lsn, XLogRecord *record) itemsz = record->xl_len - sizeof(xl_seq_rec); itemsz = MAXALIGN(itemsz); if (PageAddItem(page, (Item)item, itemsz, - FirstOffsetNumber, LP_USED) == InvalidOffsetNumber) + FirstOffsetNumber, LP_USED) == InvalidOffsetNumber) + elog(STOP, "seq_redo: failed to add item to page"); PageSetLSN(page, lsn); PageSetSUI(page, ThisStartUpID); |