Skip to content

Commit

Permalink
add failed case
Browse files Browse the repository at this point in the history
  • Loading branch information
imtbkcat committed Dec 4, 2019
1 parent c8c448e commit 5ce7af4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion executor/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ func (s *testSuite3) TestRoleAdmin(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("CREATE USER 'testRoleAdmin';")
tk.MustExec("CREATE ROLE 'targetRole';")
tk.MustExec("GRANT SUPER ON *.* TO `testRoleAdmin`;")

// Create a new session.
se, err := session.CreateSession4Test(s.store)
Expand All @@ -202,6 +201,10 @@ func (s *testSuite3) TestRoleAdmin(c *C) {

ctx := context.Background()
_, err = se.Execute(ctx, "GRANT `targetRole` TO `testRoleAdmin`;")
c.Assert(err, NotNil)

tk.MustExec("GRANT SUPER ON *.* TO `testRoleAdmin`;")
_, err = se.Execute(ctx, "GRANT `targetRole` TO `testRoleAdmin`;")
c.Assert(err, IsNil)
_, err = se.Execute(ctx, "REVOKE `targetRole` FROM `testRoleAdmin`;")
c.Assert(err, IsNil)
Expand Down

0 comments on commit 5ce7af4

Please sign in to comment.