Skip to content

Commit

Permalink
sql: add mixed version test for system.privileges user ID migration
Browse files Browse the repository at this point in the history
This patch adds a mixed version logic test that ensures granting of
system privileges continues to work properly in a cluster that has
both 22.2 and 23.1 nodes. The relevant version gate being tested here
is V23_1SystemPrivilegesTableHasUserIDColumn.

Release note: None
  • Loading branch information
andyyang890 committed Mar 25, 2023
1 parent 86ad731 commit 7bf12b6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
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 = 5,
tags = [
"cpu:2",
],
Expand Down

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

0 comments on commit 7bf12b6

Please sign in to comment.