Fix for insertion of tuple too large.

This commit is contained in:
Bruce Momjian 1999-07-03 01:47:02 +00:00
parent 97dfff832c
commit 8dd3407bf5
1 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Id: hio.c,v 1.20 1999/05/25 16:07:07 momjian Exp $
* $Id: hio.c,v 1.21 1999/07/03 01:47:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -16,6 +16,7 @@
#include <storage/bufpage.h>
#include <access/hio.h>
#include <access/htup.h>
#include <access/heapam.h>
#include <storage/bufmgr.h>
#include <utils/memutils.h>
@ -161,7 +162,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
pageHeader = (Page) BufferGetPage(buffer);
PageInit(pageHeader, BufferGetPageSize(buffer), 0);
if (len > PageGetFreeSpace(pageHeader))
if (len > PageGetFreeSpace(pageHeader) && len <= MaxTupleSize)
elog(ERROR, "Tuple is too big: size %d", len);
}