Skip to content

Commit 1e6a1d3

Browse files
author
James Cor
committed
block grant creation
1 parent a9e1469 commit 1e6a1d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sql/plan/grant.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ func (n *Grant) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {
201201
if !ok {
202202
return nil, sql.ErrDatabaseNotFound.New("mysql")
203203
}
204+
// Check if you can even persist in the first place
205+
if err := mysqlDb.ValidateCanPersist(); err != nil {
206+
return nil, err
207+
}
204208
if n.PrivilegeLevel.Database == "*" && n.PrivilegeLevel.TableRoutine == "*" {
205209
if n.ObjectType != ObjectType_Any {
206210
return nil, sql.ErrGrantRevokeIllegalPrivilege.New()

0 commit comments

Comments
 (0)