Skip to content

Commit

Permalink
Merge pull request #100032 from andyyang890/backport23.1-99533
Browse files Browse the repository at this point in the history
release-23.1: sql,backupccl: add more tests for user ID migrations
  • Loading branch information
rafiss authored Mar 30, 2023
2 parents 160e2c6 + a99b663 commit 88fc5f5
Show file tree
Hide file tree
Showing 24 changed files with 75 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/backupccl/restore_old_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ func fullClusterRestoreSystemPrivilegesWithoutIDs(exportDir string) func(t *test
sqlDB.Exec(t, fmt.Sprintf("RESTORE FROM '%s' WITH UNSAFE_RESTORE_INCOMPATIBLE_VERSION", localFoo))

sqlDB.CheckQueryResults(t, "SELECT * FROM system.privileges", [][]string{
{"public", "/vtable/crdb_internal/tables", "{}", "{}", "4"},
{"testuser1", "/global/", "{VIEWACTIVITY}", "{}", "100"},
{"testuser2", "/global/", "{MODIFYCLUSTERSETTING}", "{}", "101"},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ CREATE USER testuser2;
GRANT SYSTEM VIEWACTIVITY TO testuser1;

GRANT SYSTEM MODIFYCLUSTERSETTING TO testuser2;

REVOKE SELECT ON crdb_internal.tables FROM public;
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
U�IS
����
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
B:�|
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�w
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# LogicTest: cockroach-go-testserver-upgrade-to-master

# Set default session variables in a mixed version cluster.

statement ok
CREATE USER testuser1

upgrade 1

user root nodeidx=1

statement ok
ALTER ROLE ALL SET timezone = 'America/New_York'

statement ok
ALTER ROLE testuser1 SET application_name = 'my app'

user root nodeidx=2

statement ok
ALTER ROLE testuser1 SET index_recommendations_enabled = false

query TT
SELECT role_name, settings FROM system.database_role_settings
----
· {timezone=America/New_York}
testuser1 {"application_name=my app",index_recommendations_enabled=false}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# LogicTest: cockroach-go-testserver-upgrade-to-master

# Grant system privileges in a mixed version cluster.

statement ok
CREATE USER testuser1

upgrade 1

user root nodeidx=1

statement ok
REVOKE SELECT ON crdb_internal.tables FROM public

statement ok
GRANT SYSTEM MODIFYCLUSTERSETTING TO testuser1

user root nodeidx=2

statement ok
GRANT SYSTEM CANCELQUERY TO testuser1

query TTTT
SELECT username, path, privileges, grant_options FROM system.privileges
----
public /vtable/crdb_internal/tables {} {}
testuser1 /global/ {CANCELQUERY,MODIFYCLUSTERSETTING} {}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ go_test(
"//pkg/cmd/cockroach-short", # keep
"//pkg/sql/logictest:testdata", # keep
],
shard_count = 4,
shard_count = 6,
tags = ["cpu:2"],
deps = [
"//pkg/build/bazel",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 88fc5f5

Please sign in to comment.