code: func errorOrWarning(err error, ctx context.Context) error {
  	sc := ctx.GetSessionVars().StmtCtx
  	// TODO: Use better name, such as sc.IsInsert instead of sc.IgnoreTruncate.
  	if ctx.GetSessionVars().StrictSQLMode && !sc.IgnoreTruncate {
  		return errors.Trace(types.ErrInvalidTimeFormat)
  	}
  	sc.AppendWarning(err)
  	return nil
  }
docs: // errorOrWarning reports error or warning depend on the context.