From 11849976c5995c0f4f96acd7294ed50237635d10 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Thu, 29 Dec 2022 18:54:24 +0800 Subject: [PATCH] fixup --- planner/core/plan_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planner/core/plan_cache.go b/planner/core/plan_cache.go index 9ad197c90a2db..8036f4067ce65 100644 --- a/planner/core/plan_cache.go +++ b/planner/core/plan_cache.go @@ -280,7 +280,7 @@ func generateNewPlan(ctx context.Context, sctx sessionctx.Context, isNonPrepared if containTableDual(p) && paramNum > 0 { stmtCtx.SetSkipPlanCache(errors.New("skip plan-cache: get a TableDual plan")) } - if stmtAst.UseCache && !ignorePlanCache { + if stmtCtx.UseCache && !ignorePlanCache { // rebuild key to exclude kv.TiFlash when stmt is not read only if _, isolationReadContainTiFlash := sessVars.IsolationReadEngines[kv.TiFlash]; isolationReadContainTiFlash && !IsReadOnly(stmtAst.Stmt, sessVars) { delete(sessVars.IsolationReadEngines, kv.TiFlash)