Convert lldiv_t value to time with nanosecond rounding. @param lld The value to convert from. @param OUT ltime The variable to convert to, @param flags Conversion flags. @param IN/OUT warnings Warning flags. @return False on success, true on error. */
| 520 | @return False on success, true on error. |
| 521 | */ |
| 522 | static bool lldiv_t_to_time(lldiv_t lld, MYSQL_TIME *ltime, int *warnings) |
| 523 | { |
| 524 | if (number_to_time(lld.quot, ltime, warnings)) |
| 525 | return true; |
| 526 | /* |
| 527 | Both lld.quot and lld.rem can give negative result value, |
| 528 | thus combine them using "|=". |
| 529 | */ |
| 530 | if ((ltime->neg|= (lld.rem < 0))) |
| 531 | lld.rem= -lld.rem; |
| 532 | ltime->second_part= lld.rem / 1000; |
| 533 | return time_add_nanoseconds_with_round(ltime, lld.rem % 1000, warnings); |
| 534 | } |
| 535 | |
| 536 | |
| 537 | /* |
no test coverage detected