- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitc778f89
committed
The previous fix in CVS HEAD and 8.4 for handling the case where a cursor
being used in a PL/pgSQL FOR loop is closed was inadequate, as Tom Lanepointed out. The bug affects FOR statement variants too, because you canclose an implicitly created cursor too by guessing the "<unnamed portal X>"name created for it.To fix that, "pin" the portal to prevent it from being dropped while it'sbeing used in a PL/pgSQL FOR loop. Backpatch all the way to 7.4 which isthe oldest supported version.1 parent971e110 commitc778f89
File tree
3 files changed
+67
-8
lines changed- src
- backend/utils/mmgr
- include/utils
- pl/plpgsql/src
3 files changed
+67
-8
lines changedLines changed: 49 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
295 | 295 |
| |
296 | 296 |
| |
297 | 297 |
| |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
298 | 320 |
| |
299 | 321 |
| |
300 | 322 |
| |
| |||
304 | 326 |
| |
305 | 327 |
| |
306 | 328 |
| |
307 |
| - | |
308 |
| - | |
309 |
| - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
310 | 339 |
| |
311 | 340 |
| |
312 | 341 |
| |
| |||
507 | 536 |
| |
508 | 537 |
| |
509 | 538 |
| |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
510 | 546 |
| |
511 | 547 |
| |
512 | 548 |
| |
| |||
590 | 626 |
| |
591 | 627 |
| |
592 | 628 |
| |
593 |
| - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
594 | 638 |
| |
595 | 639 |
| |
596 | 640 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 |
| - | |
| 42 | + | |
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
138 | 139 |
| |
139 | 140 |
| |
140 | 141 |
| |
| |||
195 | 196 |
| |
196 | 197 |
| |
197 | 198 |
| |
| 199 | + | |
| 200 | + | |
198 | 201 |
| |
199 | 202 |
| |
200 | 203 |
| |
|
Lines changed: 14 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
1525 | 1525 |
| |
1526 | 1526 |
| |
1527 | 1527 |
| |
1528 |
| - | |
| 1528 | + | |
| 1529 | + | |
1529 | 1530 |
| |
1530 | 1531 |
| |
| 1532 | + | |
1531 | 1533 |
| |
1532 | 1534 |
| |
1533 | 1535 |
| |
| |||
1566 | 1568 |
| |
1567 | 1569 |
| |
1568 | 1570 |
| |
| 1571 | + | |
1569 | 1572 |
| |
1570 | 1573 |
| |
1571 | 1574 |
| |
| |||
1612 | 1615 |
| |
1613 | 1616 |
| |
1614 | 1617 |
| |
| 1618 | + | |
1615 | 1619 |
| |
1616 | 1620 |
| |
1617 | 1621 |
| |
| |||
2415 | 2419 |
| |
2416 | 2420 |
| |
2417 | 2421 |
| |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
2418 | 2428 |
| |
2419 | 2429 |
| |
2420 | 2430 |
| |
| |||
2455 | 2465 |
| |
2456 | 2466 |
| |
2457 | 2467 |
| |
| 2468 | + | |
2458 | 2469 |
| |
2459 | 2470 |
| |
2460 | 2471 |
| |
| |||
2501 | 2512 |
| |
2502 | 2513 |
| |
2503 | 2514 |
| |
| 2515 | + | |
2504 | 2516 |
| |
2505 | 2517 |
| |
2506 | 2518 |
| |
|
0 commit comments
Comments
(0)