Skip to content

Commit

Permalink
*: Revert #33519 for performance fallback and fix the #33509 in anoth…
Browse files Browse the repository at this point in the history
…er way (#34425) (#34432)

close #33509
  • Loading branch information
ti-srebot authored Jun 15, 2022
1 parent 0cbc12b commit d4f1d2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions planner/core/common_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont
// schema version like prepared plan cache key
prepared.CachedPlan = nil
preparedObj.Executor = nil
preparedObj.ColumnInfos = nil
// If the schema version has changed we need to preprocess it again,
// if this time it failed, the real reason for the error is schema changed.
// Example:
Expand Down
1 change: 1 addition & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,7 @@ func (s *session) IsCachedExecOk(ctx context.Context, preparedStmt *plannercore.
is := s.GetInfoSchema().(infoschema.InfoSchema)
if prepared.SchemaVersion != is.SchemaMetaVersion() {
prepared.CachedPlan = nil
preparedStmt.ColumnInfos = nil
return false, nil
}
}
Expand Down

0 comments on commit d4f1d2d

Please sign in to comment.