Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
glorv committed Mar 6, 2023
1 parent b5d373f commit 17c9d01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions executor/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ func TestSetResourceGroup(t *testing.T) {

tk.MustExec("CREATE RESOURCE GROUP rg1 ru_per_sec = 100")
tk.MustExec("ALTER USER `root` RESOURCE GROUP `rg1`")
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP").Check(testkit.Rows(""))
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP()").Check(testkit.Rows(""))
require.NoError(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "%"}, nil, nil))
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP").Check(testkit.Rows("rg1"))
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP()").Check(testkit.Rows("rg1"))

tk.MustExec("CREATE RESOURCE GROUP rg2 ru_per_sec = 200")
tk.MustExec("SET RESOURCE GROUP `rg2`")
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP").Check(testkit.Rows("rg2"))
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP()").Check(testkit.Rows("rg2"))
tk.MustExec("SET RESOURCE GROUP ``")
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP").Check(testkit.Rows(""))
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP()").Check(testkit.Rows(""))

tk.RefreshSession()
require.NoError(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "%"}, nil, nil))
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP").Check(testkit.Rows("rg1"))
tk.MustQuery("SELECT CURRENT_RESOURCE_GROUP()").Check(testkit.Rows("rg1"))
}

0 comments on commit 17c9d01

Please sign in to comment.