Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
CbcWestwolf committed Oct 20, 2022
1 parent 18307a9 commit c19fc41
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions executor/grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,3 +588,16 @@ func TestIssue34610(t *testing.T) {
tk.MustExec("GRANT SELECT ON T1 to user_1@localhost;")
tk.MustExec("GRANT SELECT ON t1 to user_1@localhost;")
}

func TestIssue38293(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.Session().GetSessionVars().User = &auth.UserIdentity{Username: "root", Hostname: "localhost"}
tk.MustExec("DROP USER IF EXISTS test")
tk.MustExec("CREATE USER test")
defer func() {
tk.MustExec("DROP USER test")
}()
tk.MustExec("GRANT SELECT ON `mysql`.`db` TO test")
tk.MustQuery("SELECT `Grantor` FROM `mysql`.`tables_priv` WHERE User = 'test'").Check(testkit.Rows("root@localhost"))
}

0 comments on commit c19fc41

Please sign in to comment.