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

Function TIME_to_ulonglong_datetime_round

sql/sql_time.h:173–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172
173inline ulonglong TIME_to_ulonglong_datetime_round(const MYSQL_TIME *ltime)
174{
175 // Catch simple cases
176 if (ltime->second_part < 500000)
177 return TIME_to_ulonglong_datetime(ltime);
178 if (ltime->second < 59)
179 return TIME_to_ulonglong_datetime(ltime) + 1;
180 // Corner case e.g. 'YYYY-MM-DD hh:mm:59.5'. Proceed with slower method.
181 int warnings= 0;
182 MYSQL_TIME tmp= *ltime;
183 my_datetime_round(&tmp, 0, &warnings);
184 return TIME_to_ulonglong_datetime(&tmp);// + TIME_microseconds_round(ltime);
185}
186
187
188inline ulonglong TIME_to_ulonglong_time_round(const MYSQL_TIME *ltime)

Callers 1

TIME_to_ulonglong_roundFunction · 0.85

Calls 2

my_datetime_roundFunction · 0.85

Tested by

no test coverage detected