Skip to content

Commit

Permalink
reduce inserted rows to avoid case run too long
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 372518b commit 0e5f918
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9016,13 +9016,13 @@ func (s *testSerialSuite) TestIndexJoin31494(c *C) {
tk.MustExec("drop table if exists t1, t2;")
tk.MustExec("create table t1(a int(11) default null, b int(11) default null, key(b));")
insertStr := "insert into t1 values(1, 1)"
for i := 1; i < 32768; i++ {
for i := 1; i < 3000; i++ {
insertStr += fmt.Sprintf(", (%d, %d)", i, i)
}
tk.MustExec(insertStr)
tk.MustExec("create table t2(a int(11) default null, b int(11) default null, c int(11) default null)")
insertStr = "insert into t2 values(1, 1, 1)"
for i := 1; i < 32768; i++ {
for i := 1; i < 3000; i++ {
insertStr += fmt.Sprintf(", (%d, %d, %d)", i, i, i)
}
tk.MustExec(insertStr)
Expand All @@ -9036,9 +9036,11 @@ func (s *testSerialSuite) TestIndexJoin31494(c *C) {
conf.OOMAction = config.OOMActionCancel
})
c.Assert(tk.Se.Auth(&auth.UserIdentity{Username: "root", Hostname: "%"}, nil, nil), IsTrue)
tk.MustExec("set @@tidb_mem_quota_query=2097152;")
// This bug will be reproduced in 10 times.
for i := 0; i < 10; i++ {
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;")
// 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;")
c.Assert(err, NotNil)
c.Assert(err.Error(), Matches, "Out Of Memory Quota!.*")
Expand Down

0 comments on commit 0e5f918

Please sign in to comment.