// See https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date func builtinStrToDate(args []types.Datum, _ context.Context) (types.Datum, error) { date := args[0].GetString() format := args[1].GetString() var ( d types.Datum t types.Time ) succ := t.StrToDate(date, format) if !succ { d.SetNull() return d, nil } d.SetMysqlTime(t) return d, nil }