Skip to content

Commit

Permalink
*: Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shenli committed Oct 9, 2015
1 parent 0338a07 commit 135e2c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions parser/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -4200,7 +4200,6 @@ PrivLevel:
$$ = &coldef.GrantLevel {
Level: coldef.GrantLevelGlobal,
}

}
| Identifier '.' '*'
{
Expand All @@ -4224,6 +4223,5 @@ PrivLevel:
TableName: $1.(string),
}
}

%%

5 changes: 3 additions & 2 deletions stmt/stmts/grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (s *GrantStmt) Exec(ctx context.Context) (rset.Recordset, error) {
for _, priv := range s.Privs {
if len(priv.Cols) > 0 {
// Check column scope privilege entry.
// TODO: Check validity before insert new entry.
err1 := s.checkAndInitColumnPriv(ctx, userName, host, priv.Cols)
if err1 != nil {
return nil, errors.Trace(err1)
Expand Down Expand Up @@ -728,11 +729,11 @@ func getColumnPriv(ctx context.Context, name string, host string, db string, tbl
func (s *GrantStmt) getTargetSchema(ctx context.Context) (*model.DBInfo, error) {
dbName := s.Level.DBName
if len(dbName) == 0 {
// Grant *, user current schema
// Grant *, use current schema
dbName = db.GetCurrentSchema(ctx)
}
if len(dbName) == 0 {
return nil, errors.Errorf("Miss DB name in grant db scope privilege.")
return nil, errors.New("Miss DB name for grant privilege.")
}
//check if db exists
schema := model.NewCIStr(dbName)
Expand Down

0 comments on commit 135e2c0

Please sign in to comment.