forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc5bec54
committed
Don't corrupt plpython's "TD" dictionary in a recursive trigger call.
If a plpython-language trigger caused another one to be invoked,the "TD" dictionary created for the inner one would overwrite theouter one's "TD" dictionary. This is more or less the same problemthat1d2fe56 fixed for ordinary functions in plpython, so fix itthe same way, by saving and restoring "TD" during a recursiveinvocation.This fix makes an ABI-incompatible change in struct PLySavedArgs.I'm not too worried about that because it seems highly unlikely thatany extension is messing with those structs. We could imagine doingsomething weird to preserve nominal ABI compatibility in the backbranches, like keeping the saved TD object in an extra element ofnamedargs[]. However, that would only be very nominal compatibility:if anything *is* touching PLySavedArgs, it would likely do the wrongthing due to not knowing about the additional value. So I judge itnot worth the ugliness to do something different there.(I also changed struct PLyProcedure, but its added field fitsinto formerly-padding space, so that should be safe.)Per bug #18456 from Jacques Combrink. This bug is very ancient,so back-patch to all supported branches.Discussion:https://postgr.es/m/3008982.1714853799@sss.pgh.pa.us1 parent5091995 commitc5bec54
File tree
5 files changed
+80
-3
lines changed- src/pl/plpython
- expected
- sql
5 files changed
+80
-3
lines changedLines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
618 | 618 |
| |
619 | 619 |
| |
620 | 620 |
| |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + |
Lines changed: 26 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
335 | 335 |
| |
336 | 336 |
| |
337 | 337 |
| |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
338 | 345 |
| |
339 | 346 |
| |
340 | 347 |
| |
| |||
397 | 404 |
| |
398 | 405 |
| |
399 | 406 |
| |
| 407 | + | |
400 | 408 |
| |
401 | 409 |
| |
402 | 410 |
| |
| |||
501 | 509 |
| |
502 | 510 |
| |
503 | 511 |
| |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
504 | 519 |
| |
505 | 520 |
| |
506 | 521 |
| |
| |||
550 | 565 |
| |
551 | 566 |
| |
552 | 567 |
| |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
553 | 575 |
| |
554 | 576 |
| |
555 | 577 |
| |
| |||
568 | 590 |
| |
569 | 591 |
| |
570 | 592 |
| |
571 |
| - | |
| 593 | + | |
572 | 594 |
| |
| 595 | + | |
573 | 596 |
| |
574 | 597 |
| |
575 | 598 |
| |
| |||
578 | 601 |
| |
579 | 602 |
| |
580 | 603 |
| |
581 |
| - | |
| 604 | + | |
582 | 605 |
| |
583 |
| - | |
| 606 | + | |
584 | 607 |
| |
585 | 608 |
| |
586 | 609 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
| 186 | + | |
186 | 187 |
| |
187 | 188 |
| |
188 | 189 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
| 36 | + | |
35 | 37 |
| |
36 | 38 |
| |
37 | 39 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
467 | 467 |
| |
468 | 468 |
| |
469 | 469 |
| |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + |
0 commit comments
Comments
(0)