8000 workload/schemachange: add role operations · Issue #54938 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
workload/schemachange: add role operations #54938
Open
@ajwerner

Description

@ajwerner

Is your feature request related to a problem? Please describe.

We should add operations that interact with roles to the random schema change workload. I envision that this will look like at least the below operations.

diff --git a/pkg/workload/schemachange/schemachange.go b/pkg/workload/schemachange/schemachange.go
index 42bfc6a4cc..9917730b71 100644
--- a/pkg/workload/schemachange/schemachange.go
+++ b/pkg/workload/schemachange/schemachange.go
@@ -116,6 +116,7 @@ const (
        createTableAs  // CREATE TABLE <table> AS <def>
        createView     // CREATE VIEW <view> AS <def>
        createEnum     // CREATE TYPE <type> ENUM AS <def>
+       createRole     // CREATE ROLE [IF NOT EXISTS] <name> [ [WITH] <OPTIONS...> ]
 
        dropColumn        // ALTER TABLE <table> DROP COLUMN <column>
        dropColumnDefault // ALTER TABLE <table> ALTER [COLUMN] <column> DROP DEFAULT
@@ -138,6 +139,12 @@ const (
        setColumnType    // ALTER TABLE <table> ALTER [COLUMN] <column> [SET DATA] TYPE <type>
 
        insertRow // INSERT INTO <table> (<cols>) VALUES (<values>)
+
+       grantPrivilege // GRANT {ALL | <privileges...> } ON <targets...> TO <grantees...>
+       grantRole      // GRANT <roles...> TO <grantees...> [WITH ADMIN OPTION]
+
+       revokePrivilege // REVOKE {ALL | <privileges...> } ON <targets...> FROM <grantees...>
+       revokeRole      // REVOKE [ADMIN OPTION FOR] <roles...> FROM <grantees...>
 )
 

We can also have transactions execute SET LOCAL ROLE = random_role_name at the beginning of the transaction, with some probability.

Jira issue: CRDB-3703

Epic CRDB-19168

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-random-schema-change-workloadA-schema-changesA-testingTesting tools and infrastructureC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0