Commit 4c68b16
authored
sql: Ensure role member grantor is always valid (#18781)
This commit prevents dropping a role, if that role is a grantor for some
other role membership. This helps ensure that the grantor references in
the catalog always remain valid.
As of this commit, the only valid grantor is mz_system which is
impossible to delete. So it's impossible to hit this error scenario.
However, this is more future-proof for when we implement ADMIN OPTION
and allow other grantors.
This is based off of the equivalent commit in PostgreSQL here:
postgres/postgres@6566133
That commit will be part of PostgreSQL v16 and was not included in v15.
Part of #115791 parent d2ddcc1 commit 4c68b16
6 files changed
Lines changed: 59 additions & 12 deletions
File tree
- src
- adapter/src
- coord/sequencer
- sql/src
- plan/statement
- test/upgrade
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | | - | |
| 625 | + | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| |||
7015 | 7015 | | |
7016 | 7016 | | |
7017 | 7017 | | |
| 7018 | + | |
| 7019 | + | |
| 7020 | + | |
| 7021 | + | |
| 7022 | + | |
| 7023 | + | |
| 7024 | + | |
| 7025 | + | |
| 7026 | + | |
| 7027 | + | |
7018 | 7028 | | |
7019 | 7029 | | |
7020 | 7030 | | |
| |||
7222 | 7232 | | |
7223 | 7233 | | |
7224 | 7234 | | |
7225 | | - | |
7226 | | - | |
7227 | | - | |
7228 | | - | |
7229 | | - | |
7230 | | - | |
| 7235 | + | |
| 7236 | + | |
7231 | 7237 | | |
7232 | 7238 | | |
7233 | 7239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3672 | 3672 | | |
3673 | 3673 | | |
3674 | 3674 | | |
3675 | | - | |
| 3675 | + | |
| 3676 | + | |
3676 | 3677 | | |
3677 | 3678 | | |
3678 | 3679 | | |
| |||
3713 | 3714 | | |
3714 | 3715 | | |
3715 | 3716 | | |
3716 | | - | |
| 3717 | + | |
| 3718 | + | |
3717 | 3719 | | |
3718 | 3720 | | |
3719 | 3721 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| |||
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
461 | | - | |
462 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
463 | 469 | | |
464 | 470 | | |
465 | 471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3443 | 3443 | | |
3444 | 3444 | | |
3445 | 3445 | | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
3446 | 3457 | | |
3447 | 3458 | | |
3448 | 3459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
0 commit comments