From c40ee7581ea3479334e244e8938c6dd1f6759944 Mon Sep 17 00:00:00 2001 From: James Cor Date: Tue, 20 May 2025 16:42:29 -0700 Subject: [PATCH 1/6] revoke all tests --- enginetest/queries/priv_auth_queries.go | 46 +++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/enginetest/queries/priv_auth_queries.go b/enginetest/queries/priv_auth_queries.go index bc3c44fb45..be4d88cfdf 100644 --- a/enginetest/queries/priv_auth_queries.go +++ b/enginetest/queries/priv_auth_queries.go @@ -1238,7 +1238,11 @@ var UserPrivTests = []UserPrivilegeTest{ "CREATE TABLE test (pk BIGINT PRIMARY KEY);", "INSERT INTO test VALUES (1), (2), (3);", "CREATE USER tester@localhost;", + "CREATE USER tester1@localhost;", + "CREATE USER tester2@localhost;", "GRANT ALL ON *.* TO tester@localhost;", + "GRANT ALL ON *.* TO tester1@localhost WITH GRANT OPTION;", + "GRANT ALL ON *.* TO tester2@localhost WITH GRANT OPTION;", }, Assertions: []UserPrivilegeTestAssertion{ { @@ -1280,8 +1284,46 @@ var UserPrivTests = []UserPrivilegeTest{ { User: "root", Host: "localhost", - Query: "SELECT User, Host, Select_priv, Insert_priv FROM mysql.user WHERE User = 'tester';", - Expected: []sql.Row{{"tester", "localhost", "N", "N"}}, + Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester';", + Expected: []sql.Row{{"tester", "localhost", "N", "N", "N"}}, + }, + + { + User: "root", + Host: "localhost", + Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester1';", + Expected: []sql.Row{{"tester1", "localhost", "Y", "Y", "Y"}}, + }, + { + User: "root", + Host: "localhost", + Query: "REVOKE ALL, GRANT OPTION FROM tester1@localhost;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, + { + User: "root", + Host: "localhost", + Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester1';", + Expected: []sql.Row{{"tester1", "localhost", "N", "N", "N"}}, + }, + + { + User: "root", + Host: "localhost", + Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester2';", + Expected: []sql.Row{{"tester2", "localhost", "Y", "Y", "Y"}}, + }, + { + User: "root", + Host: "localhost", + Query: "REVOKE ALL PRIVILEGES, GRANT OPTION FROM tester2@localhost;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, + { + User: "root", + Host: "localhost", + Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester2';", + Expected: []sql.Row{{"tester2", "localhost", "N", "N", "N"}}, }, }, }, From 5b53d1852c79fadc00ae8296a0d485ffc4d68b0c Mon Sep 17 00:00:00 2001 From: James Cor Date: Wed, 21 May 2025 15:33:45 -0700 Subject: [PATCH 2/6] implement ignore and if exists --- enginetest/queries/priv_auth_queries.go | 80 +++++++++++++++++++++++++ sql/plan/revoke.go | 43 +++++++------ sql/planbuilder/priv.go | 21 ++++--- sql/rowexec/priv.go | 21 ++++++- 4 files changed, 136 insertions(+), 29 deletions(-) diff --git a/enginetest/queries/priv_auth_queries.go b/enginetest/queries/priv_auth_queries.go index be4d88cfdf..c074cd4592 100644 --- a/enginetest/queries/priv_auth_queries.go +++ b/enginetest/queries/priv_auth_queries.go @@ -1230,6 +1230,27 @@ var UserPrivTests = []UserPrivilegeTest{ Query: "SELECT User, Host, Select_priv FROM mysql.user WHERE User = 'tester';", Expected: []sql.Row{{"tester", "localhost", "N"}}, }, + + { + // Re-revoking does nothing + User: "root", + Host: "localhost", + Query: "REVOKE SELECT ON *.* FROM tester@localhost;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, + { + // IF EXISTS option does nothing + User: "root", + Host: "localhost", + Query: "REVOKE IF EXISTS SELECT ON *.* FROM tester@localhost;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, + { + User: "root", + Host: "localhost", + Query: "SELECT User, Host, Select_priv FROM mysql.user WHERE User = 'tester';", + Expected: []sql.Row{{"tester", "localhost", "N"}}, + }, }, }, { @@ -1325,6 +1346,39 @@ var UserPrivTests = []UserPrivilegeTest{ Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester2';", Expected: []sql.Row{{"tester2", "localhost", "N", "N", "N"}}, }, + { + // Re-revoking does nothing + User: "root", + Host: "localhost", + Query: "REVOKE ALL PRIVILEGES, GRANT OPTION FROM tester2@localhost;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, + { + // IF EXISTS does nothing + User: "root", + Host: "localhost", + Query: "REVOKE IF EXISTS ALL PRIVILEGES, GRANT OPTION FROM tester2@localhost;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, + { + User: "root", + Host: "localhost", + Query: "SELECT User, Host, Select_priv, Insert_priv, Grant_priv FROM mysql.user WHERE User = 'tester2';", + Expected: []sql.Row{{"tester2", "localhost", "N", "N", "N"}}, + }, + { + User: "root", + Host: "localhost", + Query: "REVOKE IF EXISTS ALL PRIVILEGES, GRANT OPTION FROM fake1@localhost, fake2@localhost, fake3@localhost;", + ExpectedErr: sql.ErrRevokeUserDoesNotExist, + }, + { + // TODO: check warnings + User: "root", + Host: "localhost", + Query: "REVOKE IF EXISTS ALL PRIVILEGES, GRANT OPTION FROM fake1@localhost, fake2@localhost, fake3@localhost IGNORE UNKNOWN USER;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, }, }, { @@ -1444,6 +1498,32 @@ var UserPrivTests = []UserPrivilegeTest{ Query: "SELECT COUNT(*) FROM mysql.user WHERE User = 'tester';", Expected: []sql.Row{{1}}, }, + { + User: "root", + Host: "localhost", + Query: "REVOKE fake_role FROM tester@localhost;", + ExpectedErr: sql.ErrGrantRevokeRoleDoesNotExist, + }, + { + // TODO: check for warning + User: "root", + Host: "localhost", + Query: "REVOKE IF EXISTS fake_role FROM tester@localhost;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, + { + User: "root", + Host: "localhost", + Query: "REVOKE test_role FROM fake_user@localhost;", + ExpectedErr: sql.ErrGrantRevokeRoleDoesNotExist, + }, + { + // TODO: check for warning + User: "root", + Host: "localhost", + Query: "REVOKE test_role FROM fake_user@localhost IGNORE UNKNOWN USER;", + Expected: []sql.Row{{types.NewOkResult(0)}}, + }, }, }, { diff --git a/sql/plan/revoke.go b/sql/plan/revoke.go index d718d39e63..a618bb5042 100644 --- a/sql/plan/revoke.go +++ b/sql/plan/revoke.go @@ -26,11 +26,12 @@ import ( // Revoke represents the statement REVOKE [privilege...] ON [item] FROM [user...]. type Revoke struct { - Privileges []Privilege - ObjectType ObjectType - PrivilegeLevel PrivilegeLevel - Users []UserName - MySQLDb sql.Database + Privileges []Privilege + ObjectType ObjectType + PrivilegeLevel PrivilegeLevel + Users []UserName + IgnoreUnknownUser bool + MySQLDb sql.Database } var _ sql.Node = (*Revoke)(nil) @@ -497,9 +498,11 @@ func (*RevokeAll) CollationCoercibility(ctx *sql.Context) (collation sql.Collati // RevokeRole represents the statement REVOKE [role...] FROM [user...]. type RevokeRole struct { - Roles []UserName - TargetUsers []UserName - MySQLDb sql.Database + Roles []UserName + TargetUsers []UserName + IfExists bool + IgnoreUnknownUser bool + MySQLDb sql.Database } var _ sql.Node = (*RevokeRole)(nil) @@ -508,11 +511,13 @@ var _ sql.CollationCoercible = (*RevokeRole)(nil) var _ sql.AuthorizationCheckerNode = (*RevokeRole)(nil) // NewRevokeRole returns a new RevokeRole node. -func NewRevokeRole(roles []UserName, users []UserName) *RevokeRole { +func NewRevokeRole(roles []UserName, users []UserName, ifExists, ignoreUnknownUser bool) *RevokeRole { return &RevokeRole{ - Roles: roles, - TargetUsers: users, - MySQLDb: sql.UnresolvedDatabase("mysql"), + Roles: roles, + TargetUsers: users, + IfExists: ifExists, + IgnoreUnknownUser: ignoreUnknownUser, + MySQLDb: sql.UnresolvedDatabase("mysql"), } } @@ -613,8 +618,10 @@ func (*RevokeRole) CollationCoercibility(ctx *sql.Context) (collation sql.Collat // RevokeProxy represents the statement REVOKE PROXY. type RevokeProxy struct { - On UserName - From []UserName + On UserName + From []UserName + IfExists bool + ignoreUnknownUser bool } var _ sql.Node = (*RevokeProxy)(nil) @@ -622,10 +629,12 @@ var _ sql.CollationCoercible = (*RevokeProxy)(nil) var _ sql.AuthorizationCheckerNode = (*RevokeProxy)(nil) // NewRevokeProxy returns a new RevokeProxy node. -func NewRevokeProxy(on UserName, from []UserName) *RevokeProxy { +func NewRevokeProxy(on UserName, from []UserName, ifExists, ignoreUnknownUser bool) *RevokeProxy { return &RevokeProxy{ - On: on, - From: from, + On: on, + From: from, + IfExists: ifExists, + ignoreUnknownUser: ignoreUnknownUser, } } diff --git a/sql/planbuilder/priv.go b/sql/planbuilder/priv.go index 087fe1b6c8..73d1476317 100644 --- a/sql/planbuilder/priv.go +++ b/sql/planbuilder/priv.go @@ -516,11 +516,12 @@ func (b *Builder) buildRevokePrivilege(inScope *scope, n *ast.RevokePrivilege) ( } outScope = inScope.push() outScope.node = &plan.Revoke{ - Privileges: privs, - ObjectType: objType, - PrivilegeLevel: level, - Users: users, - MySQLDb: b.resolveDb("mysql"), + Privileges: privs, + ObjectType: objType, + PrivilegeLevel: level, + Users: users, + IgnoreUnknownUser: n.IgnoreUnknownUser, + MySQLDb: b.resolveDb("mysql"), } n.Auth.Extra = outScope.node if err := b.cat.AuthorizationHandler().HandleAuth(b.ctx, b.authQueryState, n.Auth); err != nil && b.authEnabled { @@ -542,9 +543,11 @@ func (b *Builder) buildRevokeAllPrivileges(inScope *scope, n *ast.RevokeAllPrivi func (b *Builder) buildRevokeRole(inScope *scope, n *ast.RevokeRole) (outScope *scope) { outScope = inScope.push() outScope.node = &plan.RevokeRole{ - Roles: convertAccountName(n.Roles...), - TargetUsers: convertAccountName(n.From...), - MySQLDb: b.resolveDb("mysql"), + Roles: convertAccountName(n.Roles...), + TargetUsers: convertAccountName(n.From...), + IfExists: n.IfExists, + IgnoreUnknownUser: n.IgnoreUnknownUser, + MySQLDb: b.resolveDb("mysql"), } n.Auth.Extra = outScope.node if err := b.cat.AuthorizationHandler().HandleAuth(b.ctx, b.authQueryState, n.Auth); err != nil && b.authEnabled { @@ -558,7 +561,7 @@ func (b *Builder) buildRevokeProxy(inScope *scope, n *ast.RevokeProxy) (outScope b.handleErr(err) } outScope = inScope.push() - outScope.node = plan.NewRevokeProxy(convertAccountName(n.On)[0], convertAccountName(n.From...)) + outScope.node = plan.NewRevokeProxy(convertAccountName(n.On)[0], convertAccountName(n.From...), n.IfExists, n.IgnoreUnknownUser) return } diff --git a/sql/rowexec/priv.go b/sql/rowexec/priv.go index 9e469f4c03..c0ad0415de 100644 --- a/sql/rowexec/priv.go +++ b/sql/rowexec/priv.go @@ -88,12 +88,22 @@ func (b *BaseBuilder) buildRevokeRole(ctx *sql.Context, n *plan.RevokeRole, row for _, targetUser := range n.TargetUsers { user := mysqlDb.GetUser(editor, targetUser.Name, targetUser.Host, false) if user == nil { - return nil, sql.ErrGrantRevokeRoleDoesNotExist.New(targetUser.String("`")) + err := sql.ErrGrantRevokeRoleDoesNotExist.New(targetUser.String("`")) + if n.IgnoreUnknownUser { + ctx.Warn(1362, err.Error()) + continue + } + return nil, err } for _, targetRole := range n.Roles { role := mysqlDb.GetUser(editor, targetRole.Name, targetRole.Host, true) if role == nil { - return nil, sql.ErrGrantRevokeRoleDoesNotExist.New(targetRole.String("`")) + err := sql.ErrGrantRevokeRoleDoesNotExist.New(targetUser.String("`")) + if n.IfExists { + ctx.Warn(3523, err.Error()) + continue + } + return nil, err } //TODO: if a role is mentioned in the "mandatory_roles" system variable then they cannot be revoked editor.RemoveRoleEdge(mysql_db.RoleEdgesPrimaryKey{ @@ -210,7 +220,12 @@ func (b *BaseBuilder) buildRevoke(ctx *sql.Context, n *plan.Revoke, row sql.Row) for _, revokeUser := range n.Users { user := mysqlDb.GetUser(editor, revokeUser.Name, revokeUser.Host, false) if user == nil { - return nil, sql.ErrGrantUserDoesNotExist.New() + err := sql.ErrRevokeUserDoesNotExist.New(revokeUser.Name, revokeUser.Host) + if n.IgnoreUnknownUser { + ctx.Warn(3162, err.Error()) + continue + } + return nil, err } users = append(users, user) } From 4f64e60e34b60a116947ce39213013a2e04aa444 Mon Sep 17 00:00:00 2001 From: James Cor Date: Wed, 21 May 2025 15:39:16 -0700 Subject: [PATCH 3/6] bump --- go.mod | 2 +- go.sum | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 394df0ae37..90820ee9b2 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/dolthub/go-icu-regex v0.0.0-20250327004329-6799764f2dad github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 - github.com/dolthub/vitess v0.0.0-20250512224608-8fb9c6ea092c + github.com/dolthub/vitess v0.0.0-20250521223755-3619fc293194 github.com/go-kit/kit v0.10.0 github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d github.com/gocraft/dbr/v2 v2.7.2 diff --git a/go.sum b/go.sum index 61e62568d7..edeba48e27 100644 --- a/go.sum +++ b/go.sum @@ -58,12 +58,8 @@ github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTE github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY= -github.com/dolthub/vitess v0.0.0-20250430180243-0eee73763bc5 h1:eyC/UHnNsCham/65hV9p/Si0S+cq774kbgk0/KPFYws= -github.com/dolthub/vitess v0.0.0-20250430180243-0eee73763bc5/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= -github.com/dolthub/vitess v0.0.0-20250508181115-8941c8d71af1 h1:kH6+SaEzpm9QFKqWsznzwxcYrXIB4HZq6yOaZSXwsng= -github.com/dolthub/vitess v0.0.0-20250508181115-8941c8d71af1/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= -github.com/dolthub/vitess v0.0.0-20250512224608-8fb9c6ea092c h1:imdag6PPCHAO2rZNsFoQoR4I/vIVTmO/czoOl5rUnbk= -github.com/dolthub/vitess v0.0.0-20250512224608-8fb9c6ea092c/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= +github.com/dolthub/vitess v0.0.0-20250521223755-3619fc293194 h1:VN2aNHiBKF36zdtOHkHXZt0XAmNcI/ZUwXPPrLDAt6w= +github.com/dolthub/vitess v0.0.0-20250521223755-3619fc293194/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= From 8ca75946d260fac83f0367acaae864c9e342a832 Mon Sep 17 00:00:00 2001 From: James Cor Date: Wed, 21 May 2025 16:38:23 -0700 Subject: [PATCH 4/6] remove unused node --- sql/plan/revoke.go | 70 --------------------------------- sql/planbuilder/builder.go | 2 - sql/planbuilder/priv.go | 10 ----- sql/rowexec/builder_gen_test.go | 1 - sql/rowexec/node_builder.gen.go | 2 - sql/rowexec/priv.go | 4 -- 6 files changed, 89 deletions(-) diff --git a/sql/plan/revoke.go b/sql/plan/revoke.go index a618bb5042..63e0226b14 100644 --- a/sql/plan/revoke.go +++ b/sql/plan/revoke.go @@ -426,76 +426,6 @@ func (n *Revoke) HandleRoutinePrivileges(user *mysql_db.User, dbName string, rou return nil } -// RevokeAll represents the statement REVOKE ALL PRIVILEGES. -type RevokeAll struct { - Users []UserName -} - -var _ sql.Node = (*RevokeAll)(nil) -var _ sql.CollationCoercible = (*RevokeAll)(nil) -var _ sql.AuthorizationCheckerNode = (*RevokeAll)(nil) - -// NewRevokeAll returns a new RevokeAll node. -func NewRevokeAll(users []UserName) *RevokeAll { - return &RevokeAll{ - Users: users, - } -} - -// Schema implements the interface sql.Node. -func (n *RevokeAll) Schema() sql.Schema { - return types.OkResultSchema -} - -func (n *RevokeAll) IsReadOnly() bool { - return false -} - -// String implements the interface sql.Node. -func (n *RevokeAll) String() string { - users := make([]string, len(n.Users)) - for i, user := range n.Users { - users[i] = user.String("") - } - return fmt.Sprintf("RevokeAll(From: %s)", strings.Join(users, ", ")) -} - -// Resolved implements the interface sql.Node. -func (n *RevokeAll) Resolved() bool { - return true -} - -// Children implements the interface sql.Node. -func (n *RevokeAll) Children() []sql.Node { - return nil -} - -// WithChildren implements the interface sql.Node. -func (n *RevokeAll) WithChildren(children ...sql.Node) (sql.Node, error) { - if len(children) != 0 { - return nil, sql.ErrInvalidChildrenNumber.New(n, len(children), 0) - } - return n, nil -} - -// CheckAuth implements the interface sql.AuthorizationCheckerNode. -func (n *RevokeAll) CheckAuth(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - createUser := sql.NewPrivilegedOperation(sql.PrivilegeCheckSubject{}, sql.PrivilegeType_CreateUser) - superUser := sql.NewPrivilegedOperation(sql.PrivilegeCheckSubject{}, sql.PrivilegeType_Super) - - subject := sql.PrivilegeCheckSubject{Database: "mysql"} - mysqlUpdate := sql.NewPrivilegedOperation(subject, sql.PrivilegeType_Update) - - return opChecker.UserHasPrivileges(ctx, createUser) || - opChecker.UserHasPrivileges(ctx, superUser) || - opChecker.UserHasPrivileges(ctx, mysqlUpdate) -} - -// CollationCoercibility implements the interface sql.CollationCoercible. -func (*RevokeAll) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte) { - return sql.Collation_binary, 7 -} - // RevokeRole represents the statement REVOKE [role...] FROM [user...]. type RevokeRole struct { Roles []UserName diff --git a/sql/planbuilder/builder.go b/sql/planbuilder/builder.go index 740b6bc3ec..0001fcb1ee 100644 --- a/sql/planbuilder/builder.go +++ b/sql/planbuilder/builder.go @@ -375,8 +375,6 @@ func (b *Builder) buildSubquery(inScope *scope, stmt ast.Statement, subQuery str return b.buildGrantProxy(inScope, n) case *ast.RevokePrivilege: return b.buildRevokePrivilege(inScope, n) - case *ast.RevokeAllPrivileges: - return b.buildRevokeAllPrivileges(inScope, n) case *ast.RevokeRole: return b.buildRevokeRole(inScope, n) case *ast.RevokeProxy: diff --git a/sql/planbuilder/priv.go b/sql/planbuilder/priv.go index 73d1476317..add2eed9aa 100644 --- a/sql/planbuilder/priv.go +++ b/sql/planbuilder/priv.go @@ -530,16 +530,6 @@ func (b *Builder) buildRevokePrivilege(inScope *scope, n *ast.RevokePrivilege) ( return } -func (b *Builder) buildRevokeAllPrivileges(inScope *scope, n *ast.RevokeAllPrivileges) (outScope *scope) { - outScope = inScope.push() - outScope.node = plan.NewRevokeAll(convertAccountName(n.From...)) - n.Auth.Extra = outScope.node - if err := b.cat.AuthorizationHandler().HandleAuth(b.ctx, b.authQueryState, n.Auth); err != nil && b.authEnabled { - b.handleErr(err) - } - return -} - func (b *Builder) buildRevokeRole(inScope *scope, n *ast.RevokeRole) (outScope *scope) { outScope = inScope.push() outScope.node = &plan.RevokeRole{ diff --git a/sql/rowexec/builder_gen_test.go b/sql/rowexec/builder_gen_test.go index 5580264995..1014ae6538 100644 --- a/sql/rowexec/builder_gen_test.go +++ b/sql/rowexec/builder_gen_test.go @@ -135,7 +135,6 @@ func TestGenBuilder(t *testing.T) { "ResetReplica": "*plan.ResetReplica", "TableNode": "*plan.TableNode", "Revoke": "*plan.Revoke", - "RevokeAll": "*plan.RevokeAll", "RevokeRole": "*plan.RevokeRole", "RevokeProxy": "*plan.RevokeProxy", "RowUpdateAccumulator": "plan.RowUpdateAccumulator", diff --git a/sql/rowexec/node_builder.gen.go b/sql/rowexec/node_builder.gen.go index ecca6c36ed..f51530010d 100644 --- a/sql/rowexec/node_builder.gen.go +++ b/sql/rowexec/node_builder.gen.go @@ -198,8 +198,6 @@ func (b *BaseBuilder) buildNodeExecNoAnalyze(ctx *sql.Context, n sql.Node, row s return b.buildAlterPK(ctx, n, row) case plan.Nothing: return b.buildNothing(ctx, n, row) - case *plan.RevokeAll: - return b.buildRevokeAll(ctx, n, row) case *plan.DeferredAsOfTable: return b.buildDeferredAsOfTable(ctx, n, row) case *plan.CreateUser: diff --git a/sql/rowexec/priv.go b/sql/rowexec/priv.go index c0ad0415de..792536223e 100644 --- a/sql/rowexec/priv.go +++ b/sql/rowexec/priv.go @@ -291,10 +291,6 @@ func (b *BaseBuilder) buildRevoke(ctx *sql.Context, n *plan.Revoke, row sql.Row) return rowIterWithOkResultWithZeroRowsAffected(), nil } -func (b *BaseBuilder) buildRevokeAll(ctx *sql.Context, n *plan.RevokeAll, row sql.Row) (sql.RowIter, error) { - return nil, fmt.Errorf("not yet implemented") -} - func (b *BaseBuilder) buildGrant(ctx *sql.Context, n *plan.Grant, row sql.Row) (sql.RowIter, error) { mysqlDb, ok := n.MySQLDb.(*mysql_db.MySQLDb) if !ok { From f23167145ba37ada944b3ff42050b801c8b67660 Mon Sep 17 00:00:00 2001 From: James Cor Date: Wed, 21 May 2025 16:42:39 -0700 Subject: [PATCH 5/6] bump --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 90820ee9b2..28c84c87eb 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/dolthub/go-icu-regex v0.0.0-20250327004329-6799764f2dad github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 - github.com/dolthub/vitess v0.0.0-20250521223755-3619fc293194 + github.com/dolthub/vitess v0.0.0-20250521233813-251aa9053ada github.com/go-kit/kit v0.10.0 github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d github.com/gocraft/dbr/v2 v2.7.2 diff --git a/go.sum b/go.sum index edeba48e27..3ec1d25b61 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTE github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY= -github.com/dolthub/vitess v0.0.0-20250521223755-3619fc293194 h1:VN2aNHiBKF36zdtOHkHXZt0XAmNcI/ZUwXPPrLDAt6w= -github.com/dolthub/vitess v0.0.0-20250521223755-3619fc293194/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= +github.com/dolthub/vitess v0.0.0-20250521233813-251aa9053ada h1:qjVsEsZru4x9SY2cT2bGCPNRQqxGrIpl4Fsx3zGx3/0= +github.com/dolthub/vitess v0.0.0-20250521233813-251aa9053ada/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= From 055278cfb397a3bc2cdcceb5fb14f7ea77886404 Mon Sep 17 00:00:00 2001 From: James Cor Date: Fri, 23 May 2025 10:24:32 -0700 Subject: [PATCH 6/6] bump --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 28c84c87eb..5d0336b9ff 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/dolthub/go-icu-regex v0.0.0-20250327004329-6799764f2dad github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 - github.com/dolthub/vitess v0.0.0-20250521233813-251aa9053ada + github.com/dolthub/vitess v0.0.0-20250523011542-0f6cf9472d1c github.com/go-kit/kit v0.10.0 github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d github.com/gocraft/dbr/v2 v2.7.2 diff --git a/go.sum b/go.sum index 3ec1d25b61..1289888c1b 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTE github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY= -github.com/dolthub/vitess v0.0.0-20250521233813-251aa9053ada h1:qjVsEsZru4x9SY2cT2bGCPNRQqxGrIpl4Fsx3zGx3/0= -github.com/dolthub/vitess v0.0.0-20250521233813-251aa9053ada/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= +github.com/dolthub/vitess v0.0.0-20250523011542-0f6cf9472d1c h1:23KvsBtJk2GmHpXwQ/RkwIkdNpWL8tWdHRCiidhnaUA= +github.com/dolthub/vitess v0.0.0-20250523011542-0f6cf9472d1c/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=