Skip to content

Commit

Permalink
ddl: initialize the mock session in advanced (#41227)
Browse files Browse the repository at this point in the history
close #40879
  • Loading branch information
tangenta authored Feb 9, 2023
1 parent 98fe813 commit f5efbba
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 @@ -861,6 +861,9 @@ func initSessCtx(sessCtx sessionctx.Context, sqlMode mysql.SQLMode, tzLocation *
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 nil
}

Expand Down

0 comments on commit f5efbba

Please sign in to comment.