diff --git a/executor/table_reader.go b/executor/table_reader.go index a9decdd55b1a7..db23577c87dc4 100644 --- a/executor/table_reader.go +++ b/executor/table_reader.go @@ -27,6 +27,7 @@ import ( "github.com/pingcap/tidb/parser/model" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/sessionctx" + "github.com/pingcap/tidb/sessiontxn" "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" @@ -404,7 +405,7 @@ func (e *TableReaderExecutor) buildKVReq(ctx context.Context, ranges []*ranger.R SetReadReplicaScope(e.readReplicaScope). SetIsStaleness(e.isStaleness). SetFromSessionVars(e.ctx.GetSessionVars()). - SetFromInfoSchema(e.ctx.GetInfoSchema()). + SetFromInfoSchema(sessiontxn.GetTxnManager(e.ctx).GetTxnInfoSchema()). SetMemTracker(e.memTracker). SetStoreType(e.storeType). SetAllowBatchCop(e.batchCop)