summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-09-01 14:23:03 +0400
committerSergei Golubchik <sergii@pisem.net>2011-09-01 14:23:03 +0400
commit11ebbabb087a7bd6c315e6412d8e8ee677c6217b (patch)
treee4c07766727c38df867edd12430ce55185596ff6 /sql/item_timefunc.cc
parent26bd06feef0d3f2e6f0a20457db1f8397117d2d5 (diff)
downloadmariadb-git-11ebbabb087a7bd6c315e6412d8e8ee677c6217b.tar.gz
sec_to_time() in the integer context was losing the sign of the result
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index b080f2e9707..f69d77ad6b5 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1370,7 +1370,8 @@ longlong Item_temporal_func::val_int()
MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE))
return 0;
- return (longlong)TIME_to_ulonglong(&ltime);
+ longlong v= TIME_to_ulonglong(&ltime);
+ return ltime.neg ? -v : v;
}