summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2009-11-04 09:53:38 +0100
committerMagne Mahre <magne.mahre@sun.com>2009-11-04 09:53:38 +0100
commit9c5a86377ad8b5a0fad6eca809bc432c93ed14ba (patch)
tree54a1766fc1ae03a4db0023de6e08c692d849c623 /sql/item_timefunc.cc
parent5388fbaed027a5fd04adc48dff24084052994295 (diff)
parenta91607769ab8d54cbc7bc99d3b0e8d56ed85ed80 (diff)
downloadmariadb-git-9c5a86377ad8b5a0fad6eca809bc432c93ed14ba.tar.gz
Bug#42661: sec_to_time() and signedness
Bug#42662: maketime() and signedness Item_time_typecast::val_int() dropped sign from MYSQL_TIME gotten using from get_time(). Propagates sign now. Backported to 5.5.0 (6.0-codebase revid: 1810.3897.1)
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index b5dddc38d2a..8152d4bc5df 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1802,7 +1802,7 @@ longlong Item_func_sec_to_time::val_int()
sec_to_time(arg_val, args[0]->unsigned_flag, &ltime);
return (ltime.neg ? -1 : 1) *
- ((ltime.hour)*10000 + ltime.minute*100 + ltime.second);
+ (longlong) ((ltime.hour)*10000 + ltime.minute*100 + ltime.second);
}
@@ -2614,7 +2614,8 @@ longlong Item_time_typecast::val_int()
null_value= 1;
return 0;
}
- return ltime.hour * 10000L + ltime.minute * 100 + ltime.second;
+ return (ltime.neg ? -1 : 1) *
+ (longlong) ((ltime.hour)*10000 + ltime.minute*100 + ltime.second);
}
String *Item_time_typecast::val_str(String *str)