-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-4.0This bug affects 4.0.x versions.This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.0epic/plan-cacheseverity/majorsig/plannerSIG: PlannerSIG: Plannersig/transactionSIG:TransactionSIG:Transactiontype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
func TestPlanCacheWithRCWhenInfoSchemaChange(t *testing.T) {
orgEnable := plannercore.PreparedPlanCacheEnabled()
defer func() {
plannercore.SetPreparedPlanCache(orgEnable)
}()
plannercore.SetPreparedPlanCache(true)
store, clean := createStorage(t)
defer clean()
tk1 := testkit.NewTestKit(t, store)
tk1.MustExec("use test")
tk1.MustExec("create table t1(id int primary key, c int, index ic (c))")
tk1.MustExec("prepare s from 'select /*+use_index(t1, ic)*/ * from t1 where 1'")
tk1.MustExec("set tx_isolation='READ-COMMITTED'")
tk1.MustExec("begin pessimistic")
tk1.MustQuery("execute s").Check(testkit.Rows())
tk2 := testkit.NewTestKit(t, store)
tk2.MustExec("use test")
tk2.MustExec("alter table t1 drop index ic")
tk2.MustExec("insert into t1 values(1, 0)")
// This assert will fail and the actual result is empty
tk1.MustQuery("execute s").Check(testkit.Rows("1 0"))
}
2. What did you expect to see? (Required)
The test case will pass
3. What did you see instead (Required)
Test test case failed
4. What is your TiDB version? (Required)
master
Metadata
Metadata
Assignees
Labels
affects-4.0This bug affects 4.0.x versions.This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.0epic/plan-cacheseverity/majorsig/plannerSIG: PlannerSIG: Plannersig/transactionSIG:TransactionSIG:Transactiontype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.