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

Function my_datetime_round

sql/sql_time.cc:1391–1400  ·  view source on GitHub ↗

Round datetime value to the given precision. @param IN/OUT ltime The value to round. @param dec Precision. @return False on success, true on error. */

Source from the content-addressed store, hash-verified

1389 @return False on success, true on error.
1390*/
1391bool my_datetime_round(MYSQL_TIME *ltime, uint dec, int *warnings)
1392{
1393 DBUG_ASSERT(dec <= DATETIME_MAX_DECIMALS);
1394 /* Add half away from zero */
1395 bool rc= datetime_add_nanoseconds_with_round(ltime,
1396 msec_round_add[dec], warnings);
1397 /* Truncate non-significant digits */
1398 my_time_trunc(ltime, dec);
1399 return rc;
1400}
1401
1402
1403/**

Callers 1

Calls 2

my_time_truncFunction · 0.85

Tested by

no test coverage detected