forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd102aaf
committed
Restore the portal-level snapshot for simple expressions, too.
Commits84f5c29 et al missed the need to cover plpgsql's "simpleexpression" code path. If the first thing we execute after aCOMMIT/ROLLBACK is one of those, rather than a full-fledged SPI command,we must explicitly do EnsurePortalSnapshotExists() to make sure we havean outer snapshot. Note that it wouldn't be good enough to just push asnapshot for the duration of the expression execution: what comes backmight be toasted, so we'd better have a snapshot protecting it.The test case demonstrating this fact cheats a bit by marking a SQLfunction immutable even though it fetches from a table. That'snothing that users haven't been seen to do, though.Per report from Jim Nasby. Back-patch to v11, like the previous fix.Discussion:https://postgr.es/m/378885e4-f85f-fc28-6c91-c4d1c080bf26@amazon.com1 parent8e63884 commitd102aaf
File tree
3 files changed
+49
-0
lines changed- src/pl/plpgsql/src
- expected
- sql
3 files changed
+49
-0
lines changedLines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
430 | 430 |
| |
431 | 431 |
| |
432 | 432 |
| |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
433 | 451 |
| |
434 | 452 |
| |
435 | 453 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| |||
5958 | 5959 |
| |
5959 | 5960 |
| |
5960 | 5961 |
| |
| 5962 | + | |
| 5963 | + | |
| 5964 | + | |
| 5965 | + | |
| 5966 | + | |
| 5967 | + | |
| 5968 | + | |
| 5969 | + | |
| 5970 | + | |
5961 | 5971 |
| |
5962 | 5972 |
| |
5963 | 5973 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
354 | 354 |
| |
355 | 355 |
| |
356 | 356 |
| |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
357 | 378 |
| |
358 | 379 |
| |
359 | 380 |
| |
|
0 commit comments
Comments
(0)