ddl: initialize the mock session in advanced (#41227)

close pingcap/tidb#40879
This commit is contained in:
tangenta
2023-02-09 21:26:33 +08:00
committed by GitHub
parent 98fe813b49
commit f5efbbadd1

View File

@ -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
}