summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorkroki@mysql.com <>2006-05-05 11:35:49 +0400
committerkroki@mysql.com <>2006-05-05 11:35:49 +0400
commit009cf0b75e59850cc964af2c5e34e86911e64e7d (patch)
tree614a3aef6701f4828562fe3d91e877508b2aaa14 /sql
parent98949e7a66d3117fdc45a21b2c3ee91cc88c80da (diff)
parent57ff78b5feca7aa1b9112fc5ec54d6c1f02fd3fe (diff)
downloadmariadb-git-009cf0b75e59850cc964af2c5e34e86911e64e7d.tar.gz
Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16372
Diffstat (limited to 'sql')
-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 f3d6858755c..670fb94fc2c 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -609,7 +609,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
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;
@@ -620,7 +620,8 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
case 'r':
length= my_sprintf(intbuff,
(intbuff,
- (l_time->hour < 12) ? "%02d:%02d:%02d AM" : "%02d:%02d:%02d PM",
+ ((l_time->hour % 24) < 12) ?
+ "%02d:%02d:%02d AM" : "%02d:%02d:%02d PM",
(l_time->hour+11)%12+1,
l_time->minute,
l_time->second));