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

Function my_time_round

sql/sql_time.cc:1371–1381  ·  view source on GitHub ↗

Round time 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

1369 @return False on success, true on error.
1370*/
1371bool my_time_round(MYSQL_TIME *ltime, uint dec)
1372{
1373 int warnings= 0;
1374 DBUG_ASSERT(dec <= DATETIME_MAX_DECIMALS);
1375 /* Add half away from zero */
1376 bool rc= time_add_nanoseconds_with_round(ltime,
1377 msec_round_add[dec], &warnings);
1378 /* Truncate non-significant digits */
1379 my_time_trunc(ltime, dec);
1380 return rc;
1381}
1382
1383
1384/**

Callers 1

Calls 2

my_time_truncFunction · 0.85

Tested by

no test coverage detected