Commit 74a379b9 authored by Tom Lane's avatar Tom Lane

Use repalloc_huge() to enlarge a SPITupleTable's tuple pointer array.

Commit 23a27b03 widened the rows-stored counters to uint64, but
that's academic unless we allow the tuple pointer array to exceed 1GB.

(It might be a good idea to provide some other limit on how much storage
a SPITupleTable can eat.  On the other hand, there are plenty of other
ways to drive a backend into swap hell.)

Dagfinn Ilmari Mannsåker
parent 3adf9ced
...@@ -1800,7 +1800,7 @@ spi_printtup(TupleTableSlot *slot, DestReceiver *self) ...@@ -1800,7 +1800,7 @@ spi_printtup(TupleTableSlot *slot, DestReceiver *self)
/* Double the size of the pointer array */ /* Double the size of the pointer array */
tuptable->free = tuptable->alloced; tuptable->free = tuptable->alloced;
tuptable->alloced += tuptable->free; tuptable->alloced += tuptable->free;
tuptable->vals = (HeapTuple *) repalloc(tuptable->vals, tuptable->vals = (HeapTuple *) repalloc_huge(tuptable->vals,
tuptable->alloced * sizeof(HeapTuple)); tuptable->alloced * sizeof(HeapTuple));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment