forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1d27dcf
committed
Fix bug in gistRelocateBuildBuffersOnSplit().
When we create a temporary copy of the old node buffer, in stack, we mustn'tleak that into any of the long-lived data structures. Before this patch,when we called gistPopItupFromNodeBuffer(), it got added to the array of"loaded buffers". After gistRelocateBuildBuffersOnSplit() exits, thepointer added to the loaded buffers array points to garbage. Often that goesunnotied, because when we go through the array of loaded buffers to unloadthem, buffers with a NULL pageBuffer are ignored, which can often happen byaccident even if the pointer points to garbage.This patch fixes that by marking the temporary copy in stack explicitly astemporary, and refrain from adding buffers marked as temporary to the arrayof loaded buffers.While we're at it, initialize nodeBuffer->pageBlocknum to InvalidBlockNumberand improve comments a bit. This isn't strictly necessary, but makesdebugging easier.1 parent8402fab commit1d27dcf
File tree
2 files changed
+15
-8
lines changed- src
- backend/access/gist
- include/access
2 files changed
+15
-8
lines changedLines changed: 12 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
148 | 148 |
| |
149 | 149 |
| |
150 | 150 |
| |
151 |
| - | |
| 151 | + | |
152 | 152 |
| |
| 153 | + | |
| 154 | + | |
153 | 155 |
| |
154 | 156 |
| |
155 | 157 |
| |
| |||
244 | 246 |
| |
245 | 247 |
| |
246 | 248 |
| |
247 |
| - | |
| 249 | + | |
248 | 250 |
| |
249 | 251 |
| |
250 | 252 |
| |
251 | 253 |
| |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
252 | 258 |
| |
253 | 259 |
| |
254 | 260 |
| |
| |||
591 | 597 |
| |
592 | 598 |
| |
593 | 599 |
| |
594 |
| - | |
| 600 | + | |
595 | 601 |
| |
596 | 602 |
| |
597 | 603 |
| |
| |||
619 | 625 |
| |
620 | 626 |
| |
621 | 627 |
| |
622 |
| - | |
| 628 | + | |
| 629 | + | |
623 | 630 |
| |
624 | 631 |
| |
625 | 632 |
| |
626 | 633 |
| |
627 | 634 |
| |
628 | 635 |
| |
629 |
| - | |
630 |
| - | |
631 |
| - | |
632 | 636 |
| |
633 | 637 |
| |
634 | 638 |
| |
| |||
675 | 679 |
| |
676 | 680 |
| |
677 | 681 |
| |
678 |
| - | |
| 682 | + | |
679 | 683 |
| |
680 | 684 |
| |
681 | 685 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
326 | 326 |
| |
327 | 327 |
| |
328 | 328 |
| |
| 329 | + | |
| 330 | + | |
| 331 | + | |
329 | 332 |
| |
330 | 333 |
| |
331 | 334 |
| |
|
0 commit comments
Comments
(0)