Skip to content

Commit

Permalink
fix bind test
Browse files Browse the repository at this point in the history
  • Loading branch information
lzmhhh123 committed Feb 14, 2020
1 parent cf21205 commit 6762994
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bindinfo/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,16 @@ func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) {

tk.MustExec("drop table if exists t")
tk.MustExec("create table t(a int, b int, index idx(a))")
tk.MustExec("create global binding for select * from t where a > 10 using select * from t ignore index(idx) where a > 10")
tk.MustQuery("explain select * from t where a = -1").Check(testkit.Rows(
"IndexLookUp_10 10.00 root ",
"├─IndexScan_8 10.00 cop[tikv] table:t, index:a, range:[-1,-1], keep order:false, stats:pseudo",
"└─TableScan_9 10.00 cop[tikv] table:t, keep order:false, stats:pseudo"))
tk.MustExec("create global binding for select * from t where a = 10 using select * from t ignore index(idx) where a = 10")
// Should not panic for `-1`.
tk.MustContains("select * from t where a > -1", "TableReader")
tk.MustContains("select * from t where a = -1", "Selection")
// Session bindings should be able to cover the global bindings.
tk.MustExec("drop session binding for select * from t where a > 10")
tk.MustIndexLookup("select * from t where a > -1")
tk.MustExec("drop session binding for select * from t where a = 10")
tk.MustContains("select * from t where a = -1", "IndexLookUp")
}

func (s *testSuite) TestExplain(c *C) {
Expand Down

0 comments on commit 6762994

Please sign in to comment.