Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner: output a warning if plan rebuilding fails when reusing a cached plan (#46278) #46280

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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