- Notifications
You must be signed in to change notification settings - Fork5
Commit10db3de
committed
Fix failure to account for memory used by tuplestore_putvalues().
This oversight could result in a tuplestore using much more than theintended amount of memory. It would only happen in a code path that loadeda tuplestore via tuplestore_putvalues(), and many of those won't emit hugeamounts of data; but cases such as holdable cursors and plpgsql's RETURNNEXT command could have the problem. The fix ensures that the tuplestorewill switch to write-to-disk mode when it overruns work_mem.The potential overrun was finite, because we would still count the spaceused by the tuple pointer array, so the tuplestore code would eventuallyflip into write-to-disk mode anyway. When storing wide tuples we wouldgo far past the expected work_mem usage before that happened; but thismay account for the lack of prior reports.Back-patch to 8.4, where tuplestore_putvalues was introduced.Per bug #6061 from Yann Delorme.1 parent31156ce commit10db3de
1 file changed
+5
-4
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
570 | 570 |
| |
571 | 571 |
| |
572 | 572 |
| |
573 |
| - | |
| 573 | + | |
| 574 | + | |
574 | 575 |
| |
575 | 576 |
| |
576 | 577 |
| |
| |||
580 | 581 |
| |
581 | 582 |
| |
582 | 583 |
| |
583 |
| - | |
584 |
| - | |
585 |
| - | |
| 584 | + | |
| 585 | + | |
586 | 586 |
| |
587 | 587 |
| |
588 | 588 |
| |
| |||
592 | 592 |
| |
593 | 593 |
| |
594 | 594 |
| |
| 595 | + | |
595 | 596 |
| |
596 | 597 |
| |
597 | 598 |
| |
|
0 commit comments
Comments
(0)