diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-12-12 23:38:59 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-12-12 23:38:59 +0300 |
commit | bc2d4e620ac81824b2e30bf8a1c92e164717b2e1 (patch) | |
tree | 2a2432e481d124691d9fa4b39d8a192264178bd1 /sql/item_timefunc.cc | |
parent | bd1f8f5bfaf9748ca445401687cca97a89e0dfee (diff) | |
parent | 69cfd5c8ecd20bca0e651efcbb8b5affc24c1af4 (diff) | |
download | mariadb-git-bc2d4e620ac81824b2e30bf8a1c92e164717b2e1.tar.gz |
Manual merge from mysql-trunk-merge.
Conflicts:
- extra/comp_err.c
- mysql-test/collections/default.experimental
- mysql-test/r/archive.result
- mysql-test/r/select.result
- mysql-test/suite/binlog/r/binlog_unsafe.result
- mysql-test/suite/binlog/t/binlog_unsafe.test
- mysql-test/suite/rpl/t/disabled.def
- mysql-test/t/archive.test
- mysql-test/t/select.test
- sql/item.cc
- sql/item.h
- sql/item_timefunc.cc
- sql/sql_base.cc
- sql/sql_delete.cc
- sql/sql_load.cc
- sql/sql_partition.cc
- sql/sql_table.cc
- storage/innobase/handler/ha_innodb.cc
- vio/vio.c
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 3009c48cac7..e4644aa6436 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -386,7 +386,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, if (tmp - val > 6) tmp= (char*) val + 6; l_time->second_part= (int) my_strtoll10(val, &tmp, &error); - frac_part= 6 - (uint) (tmp - val); + frac_part= 6 - (int) (tmp - val); if (frac_part > 0) l_time->second_part*= (ulong) log_10_int[frac_part]; val= tmp; @@ -876,7 +876,12 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs, const char *start= str; for (value=0; str != end && my_isdigit(cs,*str) ; str++) value= value*LL(10) + (longlong) (*str - '0'); - msec_length= 6 - (str - start); + if (transform_msec && i == count - 1) // microseconds always last + { + int msec_length= 6 - (str - start); + if (msec_length > 0) + value*= (long)log_10_int[msec_length]; + } values[i]= value; while (str != end && !my_isdigit(cs,*str)) str++; |