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

parser: introduce a new privilege for the set config statement #835

Merged
merged 2 commits into from
Apr 27, 2020
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
7 changes: 6 additions & 1 deletion mysql/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ const (
ReloadPriv
// FilePriv is the privilege to enable the use of LOAD DATA and SELECT ... INTO OUTFILE.
FilePriv
// ConfigPriv is the privilege to enable the use SET CONFIG statements.
ConfigPriv

// AllPriv is the privilege for all actions.
AllPriv
Expand Down Expand Up @@ -323,6 +325,7 @@ var Priv2UserCol = map[PrivilegeType]string{
ShutdownPriv: "Shutdown_priv",
ReloadPriv: "Reload_priv",
FilePriv: "File_priv",
ConfigPriv: "Config_priv",
}

// Col2PrivType is the privilege tables column name to privilege type.
Expand Down Expand Up @@ -355,6 +358,7 @@ var Col2PrivType = map[string]PrivilegeType{
"Shutdown_priv": ShutdownPriv,
"Reload_priv": ReloadPriv,
"File_priv": FilePriv,
"Config_priv": ConfigPriv,
}

// Command2Str is the command information to command name.
Expand Down Expand Up @@ -423,6 +427,7 @@ var Priv2Str = map[PrivilegeType]string{
ShutdownPriv: "SHUTDOWN",
ReloadPriv: "RELOAD",
FilePriv: "FILE",
ConfigPriv: "CONFIG",
}

// Priv2SetStr is the map for privilege to string.
Expand Down Expand Up @@ -461,7 +466,7 @@ var SetStr2Priv = map[string]PrivilegeType{
}

// AllGlobalPrivs is all the privileges in global scope.
var AllGlobalPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, ProcessPriv, ReferencesPriv, AlterPriv, ShowDBPriv, SuperPriv, ExecutePriv, IndexPriv, CreateUserPriv, TriggerPriv, CreateViewPriv, ShowViewPriv, CreateRolePriv, DropRolePriv, CreateTMPTablePriv, LockTablesPriv, CreateRoutinePriv, AlterRoutinePriv, EventPriv, ShutdownPriv, ReloadPriv, FilePriv}
var AllGlobalPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, ProcessPriv, ReferencesPriv, AlterPriv, ShowDBPriv, SuperPriv, ExecutePriv, IndexPriv, CreateUserPriv, TriggerPriv, CreateViewPriv, ShowViewPriv, CreateRolePriv, DropRolePriv, CreateTMPTablePriv, LockTablesPriv, CreateRoutinePriv, AlterRoutinePriv, EventPriv, ShutdownPriv, ReloadPriv, FilePriv, ConfigPriv}

// AllDBPrivs is all the privileges in database scope.
var AllDBPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, AlterPriv, ExecutePriv, IndexPriv, CreateViewPriv, ShowViewPriv}
Expand Down
Loading