Skip to content

Commit

Permalink
restore config in defer
Browse files Browse the repository at this point in the history
Signed-off-by: guo-shaoge <shaoge1994@163.com>
  • Loading branch information
guo-shaoge committed Apr 14, 2022
1 parent 0e5f918 commit b40fbdf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9036,9 +9036,18 @@ func (s *testSerialSuite) TestIndexJoin31494(c *C) {
conf.OOMAction = config.OOMActionCancel
})
c.Assert(tk.Se.Auth(&auth.UserIdentity{Username: "root", Hostname: "%"}, nil, nil), IsTrue)
oriMemQuota := tk.MustQuery("select @@tidb_mem_quota_query;").Rows()[0][0]
oriMaxChkSize := tk.MustQuery("select @@tidb_max_chunk_size;").Rows()[0][0]
oriBatchSize := tk.MustQuery("select @@tidb_index_join_batch_size;").Rows()[0][0]
tk.MustExec("set @@tidb_mem_quota_query=200000;")
tk.MustExec("set @@tidb_max_chunk_size=32;")
tk.MustExec("set @@tidb_index_join_batch_size=1;")
defer func() {
// Restore everything.
tk.MustExec(fmt.Sprintf("set @@tidb_mem_quota_query=%s;", oriMemQuota.(string)))
tk.MustExec(fmt.Sprintf("set @@tidb_max_chunk_size=%s;", oriMaxChkSize.(string)))
tk.MustExec(fmt.Sprintf("set @@tidb_index_join_batch_size=%s;", oriBatchSize.(string)))
}()
// This bug will likely be reproduced in 30 times.
for i := 0; i < 30; i++ {
err := tk.QueryToErr("select /*+ inl_join(t1) */ * from t1 right join t2 on t1.b=t2.b;")
Expand Down

0 comments on commit b40fbdf

Please sign in to comment.