- Notifications
You must be signed in to change notification settings - Fork5
Commit629b3e9
committed
Only install a portal's ResourceOwner if it actually has one.
In most scenarios a portal without a ResourceOwner is dead and not subjectto any further execution, but a portal for a cursor WITH HOLD remains inexistence with no ResourceOwner after the creating transaction is over.In this situation, if we attempt to "execute" the portal directly to fetchdata from it, we were setting CurrentResourceOwner to NULL, leading to asegfault if the datatype output code did anything that required a resourceowner (such as trying to fetch system catalog entries that weren't alreadycached). The case appears to be impossible to provoke with stock libpq,but psqlODBC at least is able to cause it when working with held cursors.Simplest fix is to just skip the assignment to CurrentResourceOwner, sothat any resources used by the data output operations will be managed bythe transaction-level resource owner instead. For consistency I changedall the places that install a portal's resowner as current, even thoughsome of them are probably not reachable with a held cursor's portal.Per report from Joshua Berry (with thanks to Hiroshi Inoue for developinga self-contained test case). Back-patch to all supported versions.1 parent6600856 commit629b3e9
2 files changed
+10
-5
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
274 | 274 |
| |
275 | 275 |
| |
276 | 276 |
| |
277 |
| - | |
| 277 | + | |
| 278 | + | |
278 | 279 |
| |
279 | 280 |
| |
280 | 281 |
| |
| |||
349 | 350 |
| |
350 | 351 |
| |
351 | 352 |
| |
352 |
| - | |
| 353 | + | |
| 354 | + | |
353 | 355 |
| |
354 | 356 |
| |
355 | 357 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
478 | 478 |
| |
479 | 479 |
| |
480 | 480 |
| |
481 |
| - | |
| 481 | + | |
| 482 | + | |
482 | 483 |
| |
483 | 484 |
| |
484 | 485 |
| |
| |||
762 | 763 |
| |
763 | 764 |
| |
764 | 765 |
| |
765 |
| - | |
| 766 | + | |
| 767 | + | |
766 | 768 |
| |
767 | 769 |
| |
768 | 770 |
| |
| |||
1411 | 1413 |
| |
1412 | 1414 |
| |
1413 | 1415 |
| |
1414 |
| - | |
| 1416 | + | |
| 1417 | + | |
1415 | 1418 |
| |
1416 | 1419 |
| |
1417 | 1420 |
| |
|
0 commit comments
Comments
(0)