summaryrefslogtreecommitdiff
path: root/sql-common/my_time.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-12-02 15:09:34 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-12-02 15:09:34 +0400
commitb97b9536c71b3ad5ef521a1f21c527057a0a01c6 (patch)
treee85de2a41e2c46f10c2fe064b400dc2f56b4749c /sql-common/my_time.c
parent928543ca6c3f37fb1f401d5fc41c71e597e76927 (diff)
downloadmariadb-git-b97b9536c71b3ad5ef521a1f21c527057a0a01c6.tar.gz
MDEV-4857 Wrong result of HOUR('1 00:00:00')
modified: mysql-test/r/func_time.result mysql-test/t/func_time.test sql-common/my_time.c sql/item_func.h sql/item_timefunc.cc sql/mysql_priv.h sql/time.cc
Diffstat (limited to 'sql-common/my_time.c')
-rw-r--r--sql-common/my_time.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index d3a968ec53f..1f058f89bb7 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -648,8 +648,8 @@ fractional:
l_time->year= 0; /* For protocol::store_time */
l_time->month= 0;
- l_time->day= date[0];
- l_time->hour= date[1];
+ l_time->day= 0;
+ l_time->hour= date[1] + date[0] * 24; /* Mix days and hours */
l_time->minute= date[2];
l_time->second= date[3];
l_time->second_part= date[4];