diff options
author | unknown <gluh@gluh.mysql.r18.ru> | 2003-06-23 12:56:44 +0500 |
---|---|---|
committer | unknown <gluh@gluh.mysql.r18.ru> | 2003-06-23 12:56:44 +0500 |
commit | f8e232f95e423897fa3898a8e34bab2fefffe7f8 (patch) | |
tree | 8b4bba86daca57ef1b882e1c341e7c9747940d89 /sql/time.cc | |
parent | 4beedd513eecdc4f57715112c1496e976a2f079c (diff) | |
download | mariadb-git-f8e232f95e423897fa3898a8e34bab2fefffe7f8.tar.gz |
Internal commit
Diffstat (limited to 'sql/time.cc')
-rw-r--r-- | sql/time.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/time.cc b/sql/time.cc index eba664a690d..81624ba7287 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -567,7 +567,7 @@ bool str_to_time(const char *str,uint length,TIME *l_time) /* Get fractional second part */ if ((end-str) >= 2 && *str == '.' && my_isdigit(&my_charset_latin1,str[1])) { - uint field_length=3; + uint field_length=5; str++; value=(uint) (uchar) (*str - '0'); while (++str != end && my_isdigit(&my_charset_latin1,str[0]) && @@ -590,6 +590,7 @@ bool str_to_time(const char *str,uint length,TIME *l_time) l_time->minute=date[2]; l_time->second=date[3]; l_time->second_part=date[4]; + l_time->time_type= TIMESTAMP_TIME; /* Check if there is garbage at end of the TIME specification */ if (str != end && current_thd->count_cuted_fields) @@ -622,3 +623,13 @@ void localtime_to_TIME(TIME *to, struct tm *from) to->minute= (int) from->tm_min; to->second= (int) from->tm_sec; } + +void calc_time_from_sec(TIME *to, long seconds, long microseconds) +{ + long t_seconds; + to->hour= seconds/3600L; + t_seconds= seconds%3600L; + to->minute= t_seconds/60L; + to->second= t_seconds%60L; + to->second_part= microseconds; +} |