Skip to content

Commit

Permalink
Added ReferencesPriv to DB and Table level, see tidb issue 26703 (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonss committed Aug 12, 2021
1 parent 2d084dd commit f8bd71b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mysql/privs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ var Priv2SetStr = map[PrivilegeType]string{
DeletePriv: "Delete",
DropPriv: "Drop",
GrantPriv: "Grant",
ReferencesPriv: "References",
AlterPriv: "Alter",
ExecutePriv: "Execute",
IndexPriv: "Index",
Expand All @@ -82,6 +83,7 @@ var SetStr2Priv = map[string]PrivilegeType{
"Delete": DeletePriv,
"Drop": DropPriv,
"Grant": GrantPriv,
"References": ReferencesPriv,
"Alter": AlterPriv,
"Execute": ExecutePriv,
"Index": IndexPriv,
Expand Down Expand Up @@ -297,10 +299,10 @@ func (privs Privileges) Has(p PrivilegeType) bool {
var AllGlobalPrivs = Privileges{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, ProcessPriv, ReferencesPriv, AlterPriv, ShowDBPriv, SuperPriv, ExecutePriv, IndexPriv, CreateUserPriv, CreateTablespacePriv, TriggerPriv, CreateViewPriv, ShowViewPriv, CreateRolePriv, DropRolePriv, CreateTMPTablePriv, LockTablesPriv, CreateRoutinePriv, AlterRoutinePriv, EventPriv, ShutdownPriv, ReloadPriv, FilePriv, ConfigPriv, ReplicationClientPriv, ReplicationSlavePriv}

// AllDBPrivs is all the privileges in database scope.
var AllDBPrivs = Privileges{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, AlterPriv, ExecutePriv, IndexPriv, CreateViewPriv, ShowViewPriv}
var AllDBPrivs = Privileges{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, ReferencesPriv, AlterPriv, ExecutePriv, IndexPriv, CreateViewPriv, ShowViewPriv}

// AllTablePrivs is all the privileges in table scope.
var AllTablePrivs = Privileges{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, IndexPriv, AlterPriv, CreateViewPriv, ShowViewPriv}
var AllTablePrivs = Privileges{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, IndexPriv, ReferencesPriv, AlterPriv, CreateViewPriv, ShowViewPriv}

// AllColumnPrivs is all the privileges in column scope.
var AllColumnPrivs = Privileges{SelectPriv, InsertPriv, UpdatePriv}
Expand Down

0 comments on commit f8bd71b

Please sign in to comment.