Skip to content

Commit

Permalink
*: parse and ignore REPLICATION CLIENT/SLAVE, USAGE privileges in gra…
Browse files Browse the repository at this point in the history
…nt statement (#4870)
  • Loading branch information
tiancaiamao committed Oct 25, 2017
1 parent 5ada5ab commit b0d20c9
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 342 deletions.
4 changes: 4 additions & 0 deletions executor/grant.go
Expand Up @@ -238,6 +238,9 @@ func (e *GrantExec) grantPriv(priv *ast.PrivElem, user *ast.UserSpec) error {

// grantGlobalPriv manipulates mysql.user table.
func (e *GrantExec) grantGlobalPriv(priv *ast.PrivElem, user *ast.UserSpec) error {
if priv.Priv == 0 {
return nil
}
asgns, err := composeGlobalPrivUpdate(priv.Priv, "Y")
if err != nil {
return errors.Trace(err)
Expand Down Expand Up @@ -284,6 +287,7 @@ func (e *GrantExec) grantColumnPriv(priv *ast.PrivElem, user *ast.UserSpec) erro
if err != nil {
return errors.Trace(err)
}

for _, c := range priv.Cols {
col := table.FindCol(tbl.Cols(), c.Name.L)
if col == nil {
Expand Down

0 comments on commit b0d20c9

Please sign in to comment.