diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-06-10 15:42:55 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-06-10 15:42:55 +0200 |
commit | f1a5c49c4e9cee40d884193dd7477aff0cbffc53 (patch) | |
tree | 6d9ac661eaa5ed19834691bab35374e609f097ec /include | |
parent | 10fedf675a1de161aec4ee09026db35400344507 (diff) | |
download | mariadb-git-f1a5c49c4e9cee40d884193dd7477aff0cbffc53.tar.gz |
various fixes for buildbot failures
Diffstat (limited to 'include')
-rw-r--r-- | include/my_time.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/my_time.h b/include/my_time.h index 8e5742f7603..c71ac4ace17 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -99,6 +99,17 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, ulong flags, int *was_cut); longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res, uint flags, int *was_cut); + +static inline +longlong double_to_datetime(double nr, MYSQL_TIME *ltime, uint flags, int *cut) +{ + if (nr < 0 || nr > LONGLONG_MAX) + nr= (double)LONGLONG_MAX; + return number_to_datetime((longlong) floor(nr), + (ulong)((nr-floor(nr))*TIME_SECOND_PART_FACTOR), + ltime, flags, cut); +} + int number_to_time(my_bool neg, longlong nr, ulong sec_part, MYSQL_TIME *ltime, int *was_cut); ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); |