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

Function str_to_time

sql/sql_time.cc:254–267  ·  view source on GitHub ↗

Character set-aware version of str_to_time() */

Source from the content-addressed store, hash-verified

252
253/* Character set-aware version of str_to_time() */
254bool str_to_time(const CHARSET_INFO *cs, const char *str,uint length,
255 MYSQL_TIME *l_time, uint flags, MYSQL_TIME_STATUS *status)
256{
257 char cnv[MAX_TIME_FULL_WIDTH + 3]; // +3 for nanoseconds (for rounding)
258 if ((cs->state & MY_CS_NONASCII) != 0)
259 {
260 length= to_ascii(cs, str, length, cnv, sizeof(cnv));
261 str= cnv;
262 }
263 return str_to_time(str, length, l_time, status) ||
264 (!(flags & TIME_NO_NSEC_ROUNDING) &&
265 time_add_nanoseconds_with_round(l_time, status->nanoseconds,
266 &status->warnings));
267}
268
269
270/* Character set-aware version of str_to_datetime() */

Callers 1

str_to_time_with_warnFunction · 0.70

Calls 2

to_asciiFunction · 0.85

Tested by

no test coverage detected