diff options
author | jimw@mysql.com <> | 2005-05-27 16:41:53 -0700 |
---|---|---|
committer | jimw@mysql.com <> | 2005-05-27 16:41:53 -0700 |
commit | 2f0c098ef55c8952e0875df91422da14170e63b8 (patch) | |
tree | 45bfdc5a424c2f2c5bddbc8295a5acc9034e30b1 /sql/item_timefunc.cc | |
parent | be4920cd813fdb5ce92897bfb710b43eaf189cac (diff) | |
download | mariadb-git-2f0c098ef55c8952e0875df91422da14170e63b8.tar.gz |
Fix '%h', '%I', and '%l' format specifiers in TIME_FORMAT()
to handle large time values as documented. (Bug #10590)
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 7a9c7898856..a99297180e5 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -497,7 +497,6 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, timestamp_type type, String *str) { char intbuff[15]; - uint days_i; uint hours_i; uint weekday; ulong length; @@ -600,8 +599,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, break; case 'h': case 'I': - days_i= l_time->hour/24; - hours_i= (l_time->hour%24 + 11)%12+1 + 24*days_i; + hours_i= (l_time->hour%24 + 11)%12+1; length= int10_to_str(hours_i, intbuff, 10) - intbuff; str->append_with_prefill(intbuff, length, 2, '0'); break; @@ -622,8 +620,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, str->append_with_prefill(intbuff, length, 1, '0'); break; case 'l': - days_i= l_time->hour/24; - hours_i= (l_time->hour%24 + 11)%12+1 + 24*days_i; + hours_i= (l_time->hour%24 + 11)%12+1; length= int10_to_str(hours_i, intbuff, 10) - intbuff; str->append_with_prefill(intbuff, length, 1, '0'); break; |