forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitea5ae3a
committed
Fix misbehavior of DROP OWNED BY with duplicate polroles entries.
Ordinarily, a pg_policy.polroles array wouldn't list the same rolemore than once; but CREATE POLICY does not prevent that. If weperform DROP OWNED BY on a role that is listed more than once,RemoveRoleFromObjectPolicy either suffered an assertion failureor encountered a tuple-updated-by-self error. Rewrite it to copecorrectly with duplicate entries, and add a CommandCounterIncrementcall to prevent the other problem.Per discussion, there's other cleanup that ought to happen here,but this seems like the minimum essential fix.Per bug #17062 from Alexander Lakhin. It's been broken all along,so back-patch to all supported branches.Discussion:https://postgr.es/m/17062-11f471ae3199ca23@postgresql.org1 parent4b8b356 commitea5ae3a
File tree
3 files changed
+46
-23
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+46
-23
lines changedLines changed: 27 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
424 | 425 |
| |
425 | 426 |
| |
426 | 427 |
| |
427 |
| - | |
428 | 428 |
| |
429 | 429 |
| |
430 |
| - | |
| 430 | + | |
431 | 431 |
| |
432 | 432 |
| |
433 | 433 |
| |
| |||
480 | 480 |
| |
481 | 481 |
| |
482 | 482 |
| |
483 |
| - | |
484 |
| - | |
485 |
| - | |
486 |
| - | |
487 |
| - | |
488 | 483 |
| |
489 |
| - | |
490 |
| - | |
491 |
| - | |
| 484 | + | |
492 | 485 |
| |
493 | 486 |
| |
494 | 487 |
| |
495 | 488 |
| |
496 | 489 |
| |
497 | 490 |
| |
498 |
| - | |
499 |
| - | |
500 |
| - | |
501 |
| - | |
502 |
| - | |
503 |
| - | |
| 491 | + | |
504 | 492 |
| |
505 | 493 |
| |
506 | 494 |
| |
507 | 495 |
| |
| 496 | + | |
508 | 497 |
| |
509 | 498 |
| |
510 | 499 |
| |
| |||
578 | 567 |
| |
579 | 568 |
| |
580 | 569 |
| |
581 |
| - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
582 | 575 |
| |
583 |
| - | |
584 |
| - | |
| 576 | + | |
| 577 | + | |
585 | 578 |
| |
586 | 579 |
| |
| 580 | + | |
| 581 | + | |
587 | 582 |
| |
588 |
| - | |
589 |
| - | |
590 |
| - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
591 | 586 |
| |
592 | 587 |
| |
593 | 588 |
| |
| |||
642 | 637 |
| |
643 | 638 |
| |
644 | 639 |
| |
| 640 | + | |
| 641 | + | |
| 642 | + | |
645 | 643 |
| |
646 | 644 |
| |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
647 | 651 |
| |
648 | 652 |
| |
649 | 653 |
| |
| |||
653 | 657 |
| |
654 | 658 |
| |
655 | 659 |
| |
656 |
| - | |
| 660 | + | |
657 | 661 |
| |
658 | 662 |
| |
659 | 663 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3906 | 3906 |
| |
3907 | 3907 |
| |
3908 | 3908 |
| |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
3909 | 3918 |
| |
3910 | 3919 |
| |
3911 | 3920 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1760 | 1760 |
| |
1761 | 1761 |
| |
1762 | 1762 |
| |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
1763 | 1773 |
| |
1764 | 1774 |
| |
1765 | 1775 |
| |
|
0 commit comments
Comments
(0)