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

Function lldiv_t_to_time

sql/sql_time.cc:522–534  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

520 @return False on success, true on error.
521*/
522static 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/*

Callers 2

Calls 2

number_to_timeFunction · 0.85

Tested by

no test coverage detected