diff options
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b305b5ccec3..a8bd219eef1 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -248,8 +248,10 @@ longlong Item_func_unix_timestamp::val_int() longlong Item_func_time_to_sec::val_int() { TIME ltime; + longlong seconds; (void) get_arg0_time(<ime); - return ltime.hour*3600L+ltime.minute*60+ltime.second; + seconds=ltime.hour*3600L+ltime.minute*60+ltime.second; + return ltime.neg ? -seconds : seconds; } |