Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql,backupccl: add more tests for user ID migrations #99533

Merged
merged 3 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
],
Expand Down

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