mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Fix for Bug#11326.
This commit is contained in:
parent
d3467c0b4c
commit
526e1a70e2
3 changed files with 31 additions and 1 deletions
|
@ -473,3 +473,21 @@ NULL
|
||||||
select str_to_date( 1, IF(1=1,NULL,NULL) );
|
select str_to_date( 1, IF(1=1,NULL,NULL) );
|
||||||
str_to_date( 1, IF(1=1,NULL,NULL) )
|
str_to_date( 1, IF(1=1,NULL,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
|
||||||
|
|
|
@ -276,3 +276,14 @@ select str_to_date( 1, NULL );
|
||||||
select str_to_date( NULL, 1 );
|
select str_to_date( NULL, 1 );
|
||||||
select str_to_date( 1, IF(1=1,NULL,NULL) );
|
select str_to_date( 1, IF(1=1,NULL,NULL) );
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#11326
|
||||||
|
#
|
||||||
|
|
||||||
|
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');
|
||||||
|
|
|
@ -620,7 +620,8 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
|
||||||
case 'r':
|
case 'r':
|
||||||
length= my_sprintf(intbuff,
|
length= my_sprintf(intbuff,
|
||||||
(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->hour+11)%12+1,
|
||||||
l_time->minute,
|
l_time->minute,
|
||||||
l_time->second));
|
l_time->second));
|
||||||
|
|
Loading…
Reference in a new issue