Skip to content

Commit

Permalink
ddl: initialize the mock session in advanced (#41227) (#41245)
Browse files Browse the repository at this point in the history
close #40879
  • Loading branch information
ti-chi-bot committed Feb 14, 2023
1 parent 07ef435 commit a263ee7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ddl/backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,9 @@ func (b *backfillScheduler) newSessCtx() (sessionctx.Context, error) {
sessCtx.GetSessionVars().StmtCtx.DividedByZeroAsWarning = !sqlMode.HasStrictMode()
sessCtx.GetSessionVars().StmtCtx.IgnoreZeroInDate = !sqlMode.HasStrictMode() || sqlMode.HasAllowInvalidDatesMode()
sessCtx.GetSessionVars().StmtCtx.NoZeroDate = sqlMode.HasStrictMode()
// Prevent initializing the mock context in the workers concurrently.
// For details, see https://github.com/pingcap/tidb/issues/40879.
_ = sessCtx.GetDomainInfoSchema()
return sessCtx, nil
}

Expand Down

0 comments on commit a263ee7

Please sign in to comment.