Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
526e1a70
Commit
526e1a70
authored
May 04, 2006
by
jani@ua141d10.elisa.omakaista.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug#11326.
parent
d3467c0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+18
-0
mysql-test/t/date_formats.test
mysql-test/t/date_formats.test
+11
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+2
-1
No files found.
mysql-test/r/date_formats.result
View file @
526e1a70
...
...
@@ -473,3 +473,21 @@ NULL
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
mysql-test/t/date_formats.test
View file @
526e1a70
...
...
@@ -276,3 +276,14 @@ select str_to_date( 1, NULL );
select
str_to_date
(
NULL
,
1
);
select
str_to_date
(
1
,
IF
(
1
=
1
,
NULL
,
NULL
)
);
# 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'
);
sql/item_timefunc.cc
View file @
526e1a70
...
...
@@ -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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment