forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4476bcb
committed
Fix misevaluation of STABLE parameters in CALL within plpgsql.
Before commit84f5c29, a STABLE function in a plpgsql CALLstatement's argument list would see an up-to-date snapshot,because exec_stmt_call would push a new snapshot. I got rid ofthat because the possibility of the snapshot disappearing withinCOMMIT made it too hard to manage a snapshot across the CALLstatement. That's fine so far as the procedure itself goes,but I forgot to think about the possibility of STABLE functionswithin the CALL argument list. As things now stand, those'llbe executed with the Portal's snapshot as ActiveSnapshot,keeping them from seeing updates more recent than Portal startup.(VOLATILE functions don't have a problem because they take theirown snapshots; which indeed is also why the procedure itselfdoesn't have a problem. There are no STABLE procedures.)We can fix this by pushing a new snapshot transiently withinExecuteCallStmt itself. Popping the snapshot before we getinto the procedure proper eliminates the management problem.The possibly-useless extra snapshot-grab is slightly annoying,but it's no worse than what happened before84f5c29.Per bug #17199 from Alexander Nawratil. Back-patch to v11,like the previous patch.Discussion:https://postgr.es/m/17199-1ab2561f0d94af92@postgresql.org1 parentade24da commit4476bcb
File tree
3 files changed
+62
-4
lines changed- src
- backend/commands
- pl/plpgsql/src
- expected
- sql
3 files changed
+62
-4
lines changedLines changed: 18 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
| 76 | + | |
76 | 77 |
| |
77 | 78 |
| |
78 | 79 |
| |
| |||
2250 | 2251 |
| |
2251 | 2252 |
| |
2252 | 2253 |
| |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
2253 | 2264 |
| |
2254 | 2265 |
| |
2255 | 2266 |
| |
| |||
2267 | 2278 |
| |
2268 | 2279 |
| |
2269 | 2280 |
| |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
2270 | 2286 |
| |
2271 | 2287 |
| |
2272 | 2288 |
| |
2273 | 2289 |
| |
| 2290 | + | |
2274 | 2291 |
| |
2275 | 2292 |
| |
2276 | 2293 |
| |
2277 | 2294 |
| |
2278 | 2295 |
| |
2279 | 2296 |
| |
2280 |
| - | |
2281 |
| - | |
2282 |
| - | |
2283 |
| - | |
| 2297 | + | |
2284 | 2298 |
| |
2285 | 2299 |
| |
2286 | 2300 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
600 | 600 |
| |
601 | 601 |
| |
602 | 602 |
| |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
603 | 624 |
| |
604 | 625 |
| |
605 | 626 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
507 | 507 |
| |
508 | 508 |
| |
509 | 509 |
| |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
510 | 533 |
| |
511 | 534 |
| |
512 | 535 |
| |
|
0 commit comments
Comments
(0)