Skip to content

Commit

Permalink
planner: do not cache the tableDual plan (#31290) (#31353)
Browse files Browse the repository at this point in the history
close #31280
  • Loading branch information
ti-srebot authored Feb 23, 2022
1 parent 22f33e7 commit c002791
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 49 deletions.
7 changes: 4 additions & 3 deletions executor/prepared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,10 @@ func (s *testSerialSuite) TestIssue28782(c *C) {

tk.MustQuery("execute stmt using @a;").Check(testkit.Rows("1"))
tk.MustQuery("execute stmt using @b;").Check(testkit.Rows("0"))
tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("1"))
// TODO(Reminiscent): Support cache more tableDual plan.
tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("0"))
tk.MustQuery("execute stmt using @c;").Check(testkit.Rows("0"))
tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("1"))
tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("0"))
}

func (s *testSerialSuite) TestIssue29850(c *C) {
Expand Down Expand Up @@ -1071,7 +1072,7 @@ func (s *testSerialSuite) TestPreparePlanCache4Function(c *C) {
tk.MustExec("set @a = 1, @b = null;")
tk.MustQuery("execute stmt using @a;").Check(testkit.Rows("1"))
tk.MustQuery("execute stmt using @b;").Check(testkit.Rows("0"))
tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("1"))
tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("0"))

tk.MustExec("drop table if exists t;")
tk.MustExec("create table t(a int);")
Expand Down
Loading

0 comments on commit c002791

Please sign in to comment.