(t *testing.T)
| 460 | } |
| 461 | |
| 462 | func TestIssue40679(t *testing.T) { |
| 463 | store := testkit.CreateMockStore(t) |
| 464 | tk := testkit.NewTestKit(t, store) |
| 465 | tk.MustExec("use test") |
| 466 | tk.MustExec("create table t (a int, key(a));") |
| 467 | tk.MustExec("prepare st from 'select * from t use index(a) where a < ?'") |
| 468 | tk.MustExec("set @a1=1.1") |
| 469 | tk.MustExec("execute st using @a1") |
| 470 | |
| 471 | tkProcess := tk.Session().ShowProcess() |
| 472 | ps := []*util.ProcessInfo{tkProcess} |
| 473 | tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps}) |
| 474 | rows := tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Rows() |
| 475 | require.True(t, strings.Contains(rows[1][0].(string), "RangeScan")) // RangeScan not FullScan |
| 476 | |
| 477 | tk.MustExec("execute st using @a1") |
| 478 | tk.MustQuery("show warnings").Check(testkit.Rows("Warning 1105 skip prepared plan-cache: '1.1' may be converted to INT")) |
| 479 | } |
| 480 | |
| 481 | func TestPlanCacheWithLimit(t *testing.T) { |
| 482 | store := testkit.CreateMockStore(t) |
nothing calls this directly
no test coverage detected