Character set-aware version of str_to_datetime() */
| 269 | |
| 270 | /* Character set-aware version of str_to_datetime() */ |
| 271 | bool 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 | /** |
no test coverage detected