MCPcopy Create free account
hub / github.com/MariaDB/server / time_to_datetime_with_warn

Function time_to_datetime_with_warn

sql/sql_time.cc:1018–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016
1017
1018bool
1019time_to_datetime_with_warn(THD *thd,
1020 const MYSQL_TIME *from, MYSQL_TIME *to,
1021 date_conv_mode_t fuzzydate)
1022{
1023 int warn= 0;
1024 DBUG_ASSERT(from->time_type == MYSQL_TIMESTAMP_TIME);
1025 /*
1026 After time_to_datetime() we need to do check_date(), as
1027 the caller may want TIME_NO_ZERO_DATE or TIME_NO_ZERO_IN_DATE.
1028 Note, the SQL standard time->datetime conversion mode always returns
1029 a valid date based on CURRENT_DATE. So we need to do check_date()
1030 only in the old mode.
1031 */
1032 if (time_to_datetime(thd, from, to) ||
1033 ((thd->variables.old_behavior & OLD_MODE_ZERO_DATE_TIME_CAST) &&
1034 check_date(to, fuzzydate, &warn)))
1035 {
1036 ErrConvTime str(from);
1037 thd->push_warning_truncated_wrong_value("datetime", str.ptr());
1038 return true;
1039 }
1040 return false;
1041}
1042
1043
1044longlong pack_time(const MYSQL_TIME *my_time)

Callers 3

make_from_itemMethod · 0.85
val_datetime_packedMethod · 0.85

Calls 4

time_to_datetimeFunction · 0.85
check_dateFunction · 0.70
ptrMethod · 0.45

Tested by

no test coverage detected