code: func (t *Time) check(sc *stmtctx.StatementContext) error {
  	allowZeroInDate := false
  	allowInvalidDate := false
  	// We should avoid passing sc as nil here as far as possible.
  	if sc != nil {
  		allowZeroInDate = sc.IgnoreZeroInDate
  		allowInvalidDate = sc.AllowInvalidDate
  	}
  	var err error
  	switch t.Type {
  	case mysql.TypeTimestamp:
  		err = checkTimestampType(sc, t.Time)
  	case mysql.TypeDatetime:
  		err = checkDatetimeType(t.Time, allowZeroInDate, allowInvalidDate)
  	case mysql.TypeDate:
  		err = checkDateType(t.Time, allowZeroInDate, allowInvalidDate)
  	}
  	return errors.Trace(err)
  }
docs: // check whether t matches valid Time format.
  // If allowZeroInDate is false, it returns ErrZeroDate when month or day is zero.
  // FIXME: See https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_in_date