List:Commits« Previous MessageNext Message »
From:jani Date:May 4 2006 5:19pm
Subject:bk commit into 4.1 tree (jani:1.2478) BUG#11324
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jani. When jani does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2478 06/05/04 20:19:37 jani@stripped +3 -0
  Fixed Bug#11324:
  TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column

  sql/item_timefunc.cc
    1.100 06/05/04 20:19:33 jani@stripped +1 -1
    Fixed Bug#11324:
    TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column

  mysql-test/t/date_formats.test
    1.17 06/05/04 20:19:33 jani@stripped +11 -0
    Added test case for Bug#11324,
    "TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column"

  mysql-test/r/date_formats.result
    1.20 06/05/04 20:19:33 jani@stripped +18 -0
    Added test case for Bug#11324,
    "TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column"

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jani
# Host:	ua141d10.elisa.omakaista.fi
# Root:	/home/my/bk/mysql-4.1

--- 1.99/sql/item_timefunc.cc	2006-05-04 19:31:06 +03:00
+++ 1.100/sql/item_timefunc.cc	2006-05-04 20:19:33 +03:00
@@ -609,7 +609,7 @@
 	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;

--- 1.19/mysql-test/r/date_formats.result	2006-05-04 19:31:06 +03:00
+++ 1.20/mysql-test/r/date_formats.result	2006-05-04 20:19:33 +03:00
@@ -491,3 +491,21 @@
 SELECT TIME_FORMAT("25:00:00", '%r');
 TIME_FORMAT("25:00:00", '%r')
 01:00:00 AM
+SELECT TIME_FORMAT("00:00:00", '%l %p');
+TIME_FORMAT("00:00:00", '%l %p')
+12 AM
+SELECT TIME_FORMAT("01:00:00", '%l %p');
+TIME_FORMAT("01:00:00", '%l %p')
+1 AM
+SELECT TIME_FORMAT("12:00:00", '%l %p');
+TIME_FORMAT("12:00:00", '%l %p')
+12 PM
+SELECT TIME_FORMAT("23:00:00", '%l %p');
+TIME_FORMAT("23:00:00", '%l %p')
+11 PM
+SELECT TIME_FORMAT("24:00:00", '%l %p');
+TIME_FORMAT("24:00:00", '%l %p')
+12 AM
+SELECT TIME_FORMAT("25:00:00", '%l %p');
+TIME_FORMAT("25:00:00", '%l %p')
+1 AM

--- 1.16/mysql-test/t/date_formats.test	2006-05-04 19:31:06 +03:00
+++ 1.17/mysql-test/t/date_formats.test	2006-05-04 20:19:33 +03:00
@@ -287,3 +287,14 @@
 SELECT TIME_FORMAT("15:00:00", '%r');
 SELECT TIME_FORMAT("01:00:00", '%r');
 SELECT TIME_FORMAT("25:00:00", '%r');
+
+#
+# Bug#11324
+#
+
+SELECT TIME_FORMAT("00:00:00", '%l %p');
+SELECT TIME_FORMAT("01:00:00", '%l %p');
+SELECT TIME_FORMAT("12:00:00", '%l %p');
+SELECT TIME_FORMAT("23:00:00", '%l %p');
+SELECT TIME_FORMAT("24:00:00", '%l %p');
+SELECT TIME_FORMAT("25:00:00", '%l %p');
Thread
bk commit into 4.1 tree (jani:1.2478) BUG#11324jani4 May