From d8d367a8f8c50bff46f5e618d10c3cad398c3b79 Mon Sep 17 00:00:00 2001 From: tsthght <781181214@qq.com> Date: Fri, 18 Oct 2019 11:28:24 +0800 Subject: [PATCH] remove GrantPriv from AllGlobalPrivs/AllDBPrivs/AllTablePrivs (#581) * remove GrantPriv from AllGlobalPrivs/AllDBPrivs/AllTablePrivs * handle testcase error --- mysql/const.go | 6 +++--- mysql/const_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql/const.go b/mysql/const.go index 93ce1f83f..b771e923a 100644 --- a/mysql/const.go +++ b/mysql/const.go @@ -442,13 +442,13 @@ var SetStr2Priv = map[string]PrivilegeType{ } // AllGlobalPrivs is all the privileges in global scope. -var AllGlobalPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, ProcessPriv, GrantPriv, ReferencesPriv, AlterPriv, ShowDBPriv, SuperPriv, ExecutePriv, IndexPriv, CreateUserPriv, TriggerPriv, CreateViewPriv, ShowViewPriv, CreateRolePriv, DropRolePriv, CreateTMPTablePriv, LockTablesPriv, CreateRoutinePriv, AlterRoutinePriv, EventPriv} +var AllGlobalPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, ProcessPriv, ReferencesPriv, AlterPriv, ShowDBPriv, SuperPriv, ExecutePriv, IndexPriv, CreateUserPriv, TriggerPriv, CreateViewPriv, ShowViewPriv, CreateRolePriv, DropRolePriv, CreateTMPTablePriv, LockTablesPriv, CreateRoutinePriv, AlterRoutinePriv, EventPriv} // AllDBPrivs is all the privileges in database scope. -var AllDBPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, GrantPriv, AlterPriv, ExecutePriv, IndexPriv, CreateViewPriv, ShowViewPriv} +var AllDBPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, AlterPriv, ExecutePriv, IndexPriv, CreateViewPriv, ShowViewPriv} // AllTablePrivs is all the privileges in table scope. -var AllTablePrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, GrantPriv, AlterPriv, IndexPriv} +var AllTablePrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, AlterPriv, IndexPriv} // AllColumnPrivs is all the privileges in column scope. var AllColumnPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv} diff --git a/mysql/const_test.go b/mysql/const_test.go index 763b010a6..7272634c1 100644 --- a/mysql/const_test.go +++ b/mysql/const_test.go @@ -39,7 +39,7 @@ func (s *testConstSuite) TestPrivAllConsistency(c *C) { c.Assert(ok, IsTrue) } - c.Assert(len(Priv2UserCol), Equals, len(AllGlobalPrivs)) + c.Assert(len(Priv2UserCol), Equals, len(AllGlobalPrivs)+1) for _, v := range Priv2UserCol { _, ok := Col2PrivType[v]