Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
imtbkcat committed Mar 19, 2019
1 parent 0faacd0 commit fece1fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
18 changes: 8 additions & 10 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,16 +790,14 @@ func (n *SetRoleStmt) Restore(ctx *RestoreCtx) error {
case SetRoleAllExcept:
ctx.WriteKeyWord(" ALL EXCEPT")
}
if len(n.RoleList) > 0 {
for i, role := range n.RoleList {
ctx.WritePlain(" ")
err := role.Restore(ctx)
if err != nil {
return errors.Annotate(err, "An error occurred while restore SetRoleStmt.RoleList")
}
if i != len(n.RoleList)-1 {
ctx.WritePlain(",")
}
for i, role := range n.RoleList {
ctx.WritePlain(" ")
err := role.Restore(ctx)
if err != nil {
return errors.Annotate(err, "An error occurred while restore SetRoleStmt.RoleList")
}
if i != len(n.RoleList)-1 {
ctx.WritePlain(",")
}
}
return nil
Expand Down
1 change: 0 additions & 1 deletion go.mod1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/pingcap/errors v0.11.0
github.com/pingcap/tidb v0.0.0-20190218065808-69472bd1a6e9
github.com/pingcap/tipb v0.0.0-20190107072121-abbec73437b7
github.com/shirou/gopsutil v2.18.12+incompatible // indirect
github.com/sirupsen/logrus v1.3.0
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
)

0 comments on commit fece1fd

Please sign in to comment.