List:Commits« Previous MessageNext Message »
From:msvensson Date:May 10 2006 7:44pm
Subject:bk commit into 5.1 tree (msvensson:1.2382)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson 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.2382 06/05/10 21:44:11 msvensson@neptunus.(none) +3 -0
  Merge neptunus.(none):/home/msvensson/mysql/tmp/tmp_merge
  into  neptunus.(none):/home/msvensson/mysql/mysql-5.1

  sql/item_timefunc.cc
    1.114 06/05/10 21:44:05 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/t/date_formats.test
    1.18 06/05/10 21:44:05 msvensson@neptunus.(none) +0 -0
    Auto merged

  mysql-test/r/date_formats.result
    1.23 06/05/10 21:44:04 msvensson@neptunus.(none) +0 -0
    Auto merged

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/mysql-5.1/RESYNC

--- 1.113/sql/item_timefunc.cc	2006-04-24 16:51:16 +02:00
+++ 1.114/sql/item_timefunc.cc	2006-05-10 21:44:05 +02:00
@@ -631,7 +631,8 @@
       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));

--- 1.22/mysql-test/r/date_formats.result	2006-02-08 21:52:04 +01:00
+++ 1.23/mysql-test/r/date_formats.result	2006-05-10 21:44:04 +02:00
@@ -515,3 +515,39 @@
 select str_to_date( 1, IF(1=1,NULL,NULL) );
 str_to_date( 1, IF(1=1,NULL,NULL) )
 NULL
+SELECT TIME_FORMAT("24:00:00", '%r');
+TIME_FORMAT("24:00:00", '%r')
+12:00:00 AM
+SELECT TIME_FORMAT("00:00:00", '%r');
+TIME_FORMAT("00:00:00", '%r')
+12:00:00 AM
+SELECT TIME_FORMAT("12:00:00", '%r');
+TIME_FORMAT("12:00:00", '%r')
+12:00:00 PM
+SELECT TIME_FORMAT("15:00:00", '%r');
+TIME_FORMAT("15:00:00", '%r')
+03:00:00 PM
+SELECT TIME_FORMAT("01:00:00", '%r');
+TIME_FORMAT("01:00:00", '%r')
+01:00:00 AM
+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.17/mysql-test/t/date_formats.test	2006-02-08 21:52:04 +01:00
+++ 1.18/mysql-test/t/date_formats.test	2006-05-10 21:44:05 +02:00
@@ -280,3 +280,33 @@
 select str_to_date( NULL, 1 );
 select str_to_date( 1, IF(1=1,NULL,NULL) );
 # End of 4.1 tests
+
+#
+# Bug#11326
+# TIME_FORMAT using "%r" returns wrong hour using 24:00:00 in TIME column
+#
+# This tests that 24:00:00 does not return PM, when it should be AM.
+# Some other values are being tested same time.
+#
+
+SELECT TIME_FORMAT("24:00:00", '%r');
+SELECT TIME_FORMAT("00:00:00", '%r');
+SELECT TIME_FORMAT("12:00:00", '%r');
+SELECT TIME_FORMAT("15:00:00", '%r');
+SELECT TIME_FORMAT("01:00:00", '%r');
+SELECT TIME_FORMAT("25:00:00", '%r');
+
+#
+# Bug#11324
+# TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column
+#
+# This tests that 24:00:00 does not change to "36:00 AM". Testing
+# some other values same time.
+#
+
+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 5.1 tree (msvensson:1.2382)msvensson10 May