MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / str_to_datetime_with_warn

Function str_to_datetime_with_warn

sql/sql_time.cc:384–396  ·  view source on GitHub ↗

Convert a timestamp string to a MYSQL_TIME value and produce a warning if string was truncated during conversion. NOTE See description of str_to_datetime() for more information. */

Source from the content-addressed store, hash-verified

382 See description of str_to_datetime() for more information.
383*/
384bool
385str_to_datetime_with_warn(String *str, MYSQL_TIME *l_time, uint flags)
386{
387 MYSQL_TIME_STATUS status;
388 THD *thd= current_thd;
389 bool ret_val= str_to_datetime(str, l_time,
390 (flags | (thd->variables.sql_mode &
391 (MODE_INVALID_DATES | MODE_NO_ZERO_DATE))),
392 &status);
393 if (ret_val || status.warnings)
394 make_truncated_value_warning(ErrConvString(str), l_time->time_type);
395 return ret_val;
396}
397
398
399/*

Callers

nothing calls this directly

Calls 3

ErrConvStringClass · 0.85
str_to_datetimeFunction · 0.70

Tested by

no test coverage detected