Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
yiguolei committed Nov 21, 2024
1 parent 4ea9858 commit feac246
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions be/src/vec/runtime/vdatetime_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ static char* append_string(const char* from, char* to) {
return to;
}

static char* append_with_prefix(const char* str, int str_len, char prefix, size_t target_len,
static char* append_with_prefix(const char* str, size_t str_len, char prefix, size_t target_len,
char* to) {
// full_len is the lower bound. if less, use prefix to pad. if greater, accept all.
size_t diff = target_len - str_len;
Expand Down Expand Up @@ -1018,7 +1018,7 @@ uint8_t VecDateTimeValue::calc_week(const VecDateTimeValue& value, uint8_t mode,
}
}

return days / 7 + 1;
return (uint8_t)(days / 7 + 1);
}

uint8_t VecDateTimeValue::week(uint8_t mode) const {
Expand Down Expand Up @@ -1627,13 +1627,16 @@ bool VecDateTimeValue::from_date_format_str(const char* format, int format_len,
}

if (already_set_date_part) {
return check_range_and_set_time(_year, _month, _day, hour, minute, second, _type);
return check_range_and_set_time(_year, _month, _day, (uint8_t)hour, (uint8_t)minute,
(uint8_t)second, _type);
}
if (already_set_time_part) {
return check_range_and_set_time(year, month, day, _hour, _minute, _second, _type);
return check_range_and_set_time((uint16_t)year, (uint8_t)month, (uint8_t)day, _hour,
_minute, _second, _type);
}

return check_range_and_set_time(year, month, day, hour, minute, second, _type);
return check_range_and_set_time((uint16_t)year, (uint8_t)month, (uint8_t)day, (uint8_t)hour,
(uint8_t)minute, (uint8_t)second, _type);
}

template <TimeUnit unit, bool need_check>
Expand Down

0 comments on commit feac246

Please sign in to comment.