| 171 | |
| 172 | |
| 173 | inline 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 | |
| 188 | inline ulonglong TIME_to_ulonglong_time_round(const MYSQL_TIME *ltime) |
no test coverage detected