Update tuple size check.

This commit is contained in:
Bruce Momjian 1999-07-03 01:56:16 +00:00
parent 8dd3407bf5
commit b1444b0934
1 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Id: hio.c,v 1.21 1999/07/03 01:47:02 momjian Exp $ * $Id: hio.c,v 1.22 1999/07/03 01:56:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -162,10 +162,13 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
pageHeader = (Page) BufferGetPage(buffer); pageHeader = (Page) BufferGetPage(buffer);
PageInit(pageHeader, BufferGetPageSize(buffer), 0); PageInit(pageHeader, BufferGetPageSize(buffer), 0);
if (len > PageGetFreeSpace(pageHeader) && len <= MaxTupleSize) if (len > PageGetFreeSpace(pageHeader))
elog(ERROR, "Tuple is too big: size %d", len); elog(ERROR, "Tuple is too big: size %d", len);
} }
if (len > MaxTupleSize)
elog(ERROR, "Tuple is too big: size %d, max size %d", len, MaxTupleSize);
if (!relation->rd_myxactonly) if (!relation->rd_myxactonly)
UnlockPage(relation, 0, ExclusiveLock); UnlockPage(relation, 0, ExclusiveLock);