Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: add unit test for assert tidb_stats_cache_mem_quota #34633

Merged
merged 7 commits into from
May 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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