summaryrefslogtreecommitdiff
path: root/sql/time.cc
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2003-06-23 13:02:28 +0500
committerunknown <gluh@gluh.mysql.r18.ru>2003-06-23 13:02:28 +0500
commitb68315cda61f71f3bf176e97f14f40d8c3bf528d (patch)
treec85cbf69cadd2227fc5b39798cde168c83bdf56b /sql/time.cc
parentbd2c3ef725acf6c1e30ab5880324e5135649e98a (diff)
parentf8e232f95e423897fa3898a8e34bab2fefffe7f8 (diff)
downloadmariadb-git-b68315cda61f71f3bf176e97f14f40d8c3bf528d.tar.gz
Merge gluh@gw:/home/bk/mysql-4.1
into gluh.mysql.r18.ru:/home/gluh/mysql-4.1.DTFUNC sql/field.cc: Auto merged sql/item_create.cc: Auto merged sql/item_create.h: Auto merged sql/lex.h: Auto merged sql/mysql_priv.h: Auto merged sql/protocol.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/time.cc: Auto merged
Diffstat (limited to 'sql/time.cc')
-rw-r--r--sql/time.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/time.cc b/sql/time.cc
index b6ca306e523..056adf050ce 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -581,7 +581,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]) &&
@@ -604,6 +604,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)
@@ -636,3 +637,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;
+}