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

executor: notify TiDB update privilege after alter/drop user #5226

Merged
merged 2 commits into from
Nov 27, 2017
Merged
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
2 changes: 2 additions & 0 deletions executor/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func (e *SimpleExec) executeAlterUser(s *ast.AlterUserStmt) error {
errMsg := "Operation ALTER USER failed for " + strings.Join(failedUsers, ",")
return terror.ClassExecutor.New(CodeCannotUser, errMsg)
}
domain.GetDomain(e.ctx).NotifyUpdatePrivilege(e.ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we meet error here, add a log.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotifyUpdatePrivilege already log errors.

return nil
}

Expand Down Expand Up @@ -250,6 +251,7 @@ func (e *SimpleExec) executeDropUser(s *ast.DropUserStmt) error {
errMsg := "Operation DROP USER failed for " + strings.Join(failedUsers, ",")
return terror.ClassExecutor.New(CodeCannotUser, errMsg)
}
domain.GetDomain(e.ctx).NotifyUpdatePrivilege(e.ctx)
return nil
}

Expand Down