summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-12-15 15:57:26 +0100
committerSergei Golubchik <sergii@pisem.net>2013-12-15 15:57:26 +0100
commit6bf10fac445d73fb796d4863612c87bff5f28b66 (patch)
tree4d51e193684163c21e47e9de6536cd8dae0613eb /sql/item_timefunc.cc
parent8efaff4959efe32ff9bc47c1bf1710cfe9ab21b5 (diff)
parent39a8d7965d912d8fb32436735449ce04e85583d1 (diff)
downloadmariadb-git-6bf10fac445d73fb796d4863612c87bff5f28b66.tar.gz
5.5 merge
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 425008ab43b..a3652ebf16e 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2142,6 +2142,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(&ltime);
+
switch (int_type) {
case INTERVAL_YEAR: return ltime.year;
case INTERVAL_YEAR_MONTH: return ltime.year*100L+ltime.month;