Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Sep 11, 2023
1 parent fbf2de1 commit 25e6a68
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion planner/core/plan_cacheable_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"errors"
"fmt"
"math"
"strings"
"sync"

"github.com/pingcap/tidb/expression"
Expand Down Expand Up @@ -623,7 +624,12 @@ func getMaxParamLimit(sctx sessionctx.Context) int {

// checkTableCacheable checks whether a query accessing this table is cacheable.
func checkTableCacheable(ctx context.Context, sctx sessionctx.Context, schema infoschema.InfoSchema, node *ast.TableName, isNonPrep bool) (cacheable bool, reason string) {
tb, err := schema.TableByName(node.Schema, node.Name)
tableSchema := node.Schema
if tableSchema.L == "" {
tableSchema.O = sctx.GetSessionVars().CurrentDB
tableSchema.L = strings.ToLower(tableSchema.O)
}
tb, err := schema.TableByName(tableSchema, node.Name)
if intest.InTest && ctx != nil && ctx.Value(PlanCacheKeyTestIssue46760) != nil {
err = errors.New("mock error")
}
Expand Down

0 comments on commit 25e6a68

Please sign in to comment.