Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#46278
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
qw4990 authored and ti-chi-bot committed Aug 21, 2023
1 parent 8040e28 commit c0834aa
Show file tree
Hide file tree
Showing 2 changed files with 423 additions and 0 deletions.
13 changes: 13 additions & 0 deletions planner/core/plan_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,20 @@ func RebuildPlan4CachedPlan(p Plan) error {
sc := p.SCtx().GetSessionVars().StmtCtx
sc.InPreparedPlanBuilding = true
defer func() { sc.InPreparedPlanBuilding = false }()
<<<<<<< HEAD
return rebuildRange(p)
=======
if err := rebuildRange(p); err != nil {
sc.AppendWarning(errors.Errorf("skip plan-cache: plan rebuild failed, %s", err.Error()))
return false // fail to rebuild ranges
}
if !sc.UseCache {
// in this case, the UseCache flag changes from `true` to `false`, then there must be some
// over-optimized operations were triggered, return `false` for safety here.
return false
}
return true
>>>>>>> 94cfa8b0713 (planner: output a warning if plan rebuilding fails when reusing a cached plan (#46278))
}

func updateRange(p PhysicalPlan, ranges ranger.Ranges, rangeInfo string) {
Expand Down
Loading

0 comments on commit c0834aa

Please sign in to comment.