diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-12-02 15:09:34 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-12-02 15:09:34 +0400 |
commit | b97b9536c71b3ad5ef521a1f21c527057a0a01c6 (patch) | |
tree | e85de2a41e2c46f10c2fe064b400dc2f56b4749c /sql/item_timefunc.cc | |
parent | 928543ca6c3f37fb1f401d5fc41c71e597e76927 (diff) | |
download | mariadb-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/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 3baf583eaa0..b618ec038f2 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2033,6 +2033,10 @@ longlong Item_extract::val_int() return 0; neg= ltime.neg ? -1 : 1; + DBUG_ASSERT(ltime.time_type != MYSQL_TIMESTAMP_TIME || ltime.day == 0); + if (ltime.time_type == MYSQL_TIMESTAMP_TIME) + time_to_daytime_interval(<ime); + switch (int_type) { case INTERVAL_YEAR: return ltime.year; case INTERVAL_YEAR_MONTH: return ltime.year*100L+ltime.month; |