- Notifications
You must be signed in to change notification settings - Fork28
Commit2e78c5b
committed
Fix assert in nested SQL procedure call
When executing CALL in PL/pgSQL, we need to set a snapshot beforeinvoking the to-be-called procedure. Otherwise, the to-be-calledprocedure might end up running without a snapshot. For LANGUAGE SQLprocedures, this would result in an assertion failure. (For most otherlanguages, this is usually not a problem, because those use SPI and SPIsets snapshots in most cases.) Setting the snapshot restores thebehavior of how CALL worked when it was handled as a generic SQLstatement in PL/pgSQL (exec_stmt_execsql()).This change revealed another problem: In SPI_commit(), we popped theactive snapshot before committing the transaction, to avoid "snapshot %pstill active" errors. However, there is no particular reason why onlyat most one snapshot should be on the stack. So change this to pop allactive snapshots instead of only one.1 parente34ec13 commit2e78c5b
File tree
4 files changed
+72
-6
lines changed- src
- backend/executor
- pl/plpgsql/src
- expected
- sql
4 files changed
+72
-6
lines changedLines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
231 |
| - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
232 | 236 |
| |
| 237 | + | |
233 | 238 |
| |
234 | 239 |
| |
235 | 240 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
432 | 432 |
| |
433 | 433 |
| |
434 | 434 |
| |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
435 | 454 |
| |
436 | 455 |
| |
437 | 456 |
|
Lines changed: 27 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2075 | 2075 |
| |
2076 | 2076 |
| |
2077 | 2077 |
| |
| 2078 | + | |
2078 | 2079 |
| |
2079 | 2080 |
| |
2080 | 2081 |
| |
| |||
2090 | 2091 |
| |
2091 | 2092 |
| |
2092 | 2093 |
| |
| 2094 | + | |
2093 | 2095 |
| |
2094 | 2096 |
| |
2095 | 2097 |
| |
| |||
2098 | 2100 |
| |
2099 | 2101 |
| |
2100 | 2102 |
| |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
2101 | 2113 |
| |
2102 | 2114 |
| |
2103 | 2115 |
| |
| |||
2126 | 2138 |
| |
2127 | 2139 |
| |
2128 | 2140 |
| |
2129 |
| - | |
2130 |
| - | |
2131 |
| - | |
2132 |
| - | |
2133 |
| - | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
2134 | 2152 |
| |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
2135 | 2157 |
| |
2136 | 2158 |
| |
2137 | 2159 |
| |
|
Lines changed: 20 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 | + | |
357 | 377 |
| |
358 | 378 |
| |
359 | 379 |
|
0 commit comments
Comments
(0)