func (e *GrantExec) grantPriv(priv *ast.PrivElem, user *ast.UserSpec) error {
	switch e.Level.Level {
	case ast.GrantLevelGlobal:
		return e.grantGlobalPriv(priv, user)
	case ast.GrantLevelDB:
		return e.grantDBPriv(priv, user)
	case ast.GrantLevelTable:
		if len(priv.Cols) == 0 {
			return e.grantTablePriv(priv, user)
		}
		return e.grantColumnPriv(priv, user)
	default:
		return errors.Errorf("Unknown grant level: %#v", e.Level)
	}
}
// Grant priv to user in s.Level scope.
Grant priv to user in s.Level scope.
// Grant priv to user in s . Level scope .
func (e *GrantExec) grantPriv(priv *ast.PrivElem, user *ast.UserSpec) error {
	switch e.Level.Level {
	case ast.GrantLevelGlobal:
		return e.grantGlobalPriv(priv, user)
	case ast.GrantLevelDB:
		return e.grantDBPriv(priv, user)
	case ast.GrantLevelTable:
		if len(priv.Cols) == 0 {
			return e.grantTablePriv(priv, user)
		}
		return e.grantColumnPriv(priv, user)
	default:
		return errors.Errorf("Unknown grant level: %#v", e.Level)
	}
}
func ( e * GrantExec ) grantPriv ( priv * ast . PrivElem , user * ast . UserSpec ) error { switch e . Level . Level { case ast . GrantLevelGlobal : return e . grantGlobalPriv ( priv , user ) case ast . GrantLevelDB : return e . grantDBPriv ( priv , user ) case ast . GrantLevelTable : if len ( priv . Cols ) == 0 { return e . grantTablePriv ( priv , user ) } return e . grantColumnPriv ( priv , user ) default : return errors . Errorf ( " " , e . Level ) } }
Grant priv to user in s.Level scope.
Grant priv to user in s . Level scope .