Skip to content

Commit cb91d65

Browse files
committed
fixup
1 parent 12f0ce5 commit cb91d65

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

expression/builtin_compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package expression
1616

1717
import (
18-
"github.com/pkg/errors"
1918
"math"
2019
"strings"
2120

@@ -29,6 +28,7 @@ import (
2928
"github.com/pingcap/tidb/util/chunk"
3029
"github.com/pingcap/tidb/util/collate"
3130
"github.com/pingcap/tipb/go-tipb"
31+
"github.com/pkg/errors"
3232
)
3333

3434
var (

planner/core/plan_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func generateNewPlan(ctx context.Context, sctx sessionctx.Context, isNonPrepared
278278

279279
// We only cache the tableDual plan when the number of parameters are zero.
280280
if containTableDual(p) && paramNum > 0 {
281-
stmtCtx.SetSkipPlanCache(errors.New("cannot cache TableDual"))
281+
stmtCtx.SetSkipPlanCache(errors.New("skip plan-cache: get a TableDual plan"))
282282
}
283283
if stmtAst.UseCache && !stmtCtx.SkipPlanCache && !ignorePlanCache {
284284
// rebuild key to exclude kv.TiFlash when stmt is not read only

sessionctx/stmtctx/stmtctx.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ func (sc *StatementContext) SetPlanHint(hint string) {
611611

612612
// SetSkipPlanCache sets to skip the plan cache and records the reason.
613613
func (sc *StatementContext) SetSkipPlanCache(reason error) {
614-
if sc.SkipPlanCache {
615-
return
614+
if sc.UseCache && sc.SkipPlanCache {
615+
return // avoid unnecessary warnings
616616
}
617617
sc.SkipPlanCache = true
618618
sc.AppendWarning(reason)

0 commit comments

Comments
 (0)