Skip to content

Commit

Permalink
config: add unit test for assert tidb_stats_cache_mem_quota (#34633)
Browse files Browse the repository at this point in the history
ref #34052
  • Loading branch information
Yisaer authored May 13, 2022
1 parent 19b8565 commit ad53ac2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions executor/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,12 @@ func TestSetVar(t *testing.T) {
tk.MustQuery("select @@global.tidb_stats_cache_mem_quota").Check(testkit.Rows("0"))
tk.MustExec("set global tidb_stats_cache_mem_quota = 200")
tk.MustQuery("select @@global.tidb_stats_cache_mem_quota").Check(testkit.Rows("200"))
// assert quota must larger than -1
tk.MustExec("set global tidb_stats_cache_mem_quota = -1")
tk.MustQuery("select @@global.tidb_stats_cache_mem_quota").Check(testkit.Rows("0"))
// assert quota muster smaller than 1TB
tk.MustExec("set global tidb_stats_cache_mem_quota = 1099511627777")
tk.MustQuery("select @@global.tidb_stats_cache_mem_quota").Check(testkit.Rows("1099511627776"))
// for read-only instance scoped system variables.
tk.MustGetErrCode("set @@global.plugin_load = ''", errno.ErrIncorrectGlobalLocalVar)
tk.MustGetErrCode("set @@global.plugin_dir = ''", errno.ErrIncorrectGlobalLocalVar)
Expand Down

0 comments on commit ad53ac2

Please sign in to comment.