-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql,backupccl: set system.role_members ID columns to NOT NULL
This patch sets the newly added `role_id` and `member_id` columns in `system.role_members` to be NOT NULL. It also changes the `RESTORE` logic to be able to handle the case when restoring from a backup where the `system.role_members` table did not have the columns. Release note: None
- Loading branch information
1 parent
0f6333c
commit db94d07
Showing
21 changed files
with
182 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
pkg/ccl/backupccl/testdata/restore_old_versions/create-system-role-members.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- The below SQL is used to create the data that is then exported with BACKUP | ||
-- for use in the TestRestoreOldVersions test. This should be run on a v22.2 | ||
-- cluster and used to test that after a restore on a v23.1 cluster, the ID | ||
-- columns in the system.role_members table are backfilled. | ||
|
||
CREATE DATABASE test; | ||
|
||
SET database = test; | ||
|
||
CREATE ROLE testrole; | ||
|
||
CREATE USER testuser1; | ||
|
||
CREATE USER testuser2; | ||
|
||
GRANT testrole TO testuser1; | ||
|
||
GRANT testrole TO testuser2 WITH ADMIN OPTION; |
1 change: 1 addition & 0 deletions
1
...a/restore_old_versions/system-role-members-restore/v22.2.1/BACKUP-LOCK-824672390336479233
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lock |
Empty file.
Binary file added
BIN
+2.8 KB
...ckupccl/testdata/restore_old_versions/system-role-members-restore/v22.2.1/BACKUP_MANIFEST
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...estdata/restore_old_versions/system-role-members-restore/v22.2.1/BACKUP_MANIFEST-CHECKSUM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
�*4S |
Binary file added
BIN
+2.49 KB
...data/restore_old_versions/system-role-members-restore/v22.2.1/data/824672393313517569.sst
Binary file not shown.
Binary file added
BIN
+2.79 KB
...ddfcdcfc5cdcfc5cbced1c6c9cfcac7cadfd4cfcfcfcfdfaaabbcdf92c2d4cdcbd1cdcbc8c9c7cbccc8c9fffe
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...cdcfc5cbced1c6c9cfcac7cadfd4cfcfcfcfdfaaabbcdf92c2d4cdcbd1cdcbc8c9c7cbccc8c9fffe-CHECKSUM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ΰ" |
Binary file added
BIN
+2.66 KB
...ddfcdcfc5cdcfc5cbced1c8cec9cec9c7dfd4cfcfcfcfdfaaabbcdf92c2d4cdcbd1cfcfcccdc9c7cfcbccfffe
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...cdcfc5cbced1c8cec9cec9c7dfd4cfcfcfcfdfaaabbcdf92c2d4cdcbd1cfcfcccdc9c7cfcbccfffe-CHECKSUM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
D6, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.