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

Function str_to_datetime

sql/sql_time.cc:271–287  ·  view source on GitHub ↗

Character set-aware version of str_to_datetime() */

Source from the content-addressed store, hash-verified

269
270/* Character set-aware version of str_to_datetime() */
271bool str_to_datetime(const CHARSET_INFO *cs,
272 const char *str, uint length,
273 MYSQL_TIME *l_time, uint flags,
274 MYSQL_TIME_STATUS *status)
275{
276 char cnv[MAX_DATETIME_FULL_WIDTH + 3]; // +3 for nanoseconds (for rounding)
277 if ((cs->state & MY_CS_NONASCII) != 0)
278 {
279 length= to_ascii(cs, str, length, cnv, sizeof(cnv));
280 str= cnv;
281 }
282 return str_to_datetime(str, length, l_time, flags, status) ||
283 (!(flags & TIME_NO_NSEC_ROUNDING) &&
284 datetime_add_nanoseconds_with_round(l_time,
285 status->nanoseconds,
286 &status->warnings));
287}
288
289
290/**

Callers 1

Calls 2

to_asciiFunction · 0.85

Tested by

no test coverage detected