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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
06d6b747
Commit
06d6b747
authored
May 04, 2006
by
jani@ua141d10.elisa.omakaista.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Bug#11324:
TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column
parent
526e1a70
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-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
+1
-1
No files found.
mysql-test/r/date_formats.result
View file @
06d6b747
...
@@ -491,3 +491,21 @@ TIME_FORMAT("01:00:00", '%r')
...
@@ -491,3 +491,21 @@ TIME_FORMAT("01:00:00", '%r')
SELECT TIME_FORMAT("25:00:00", '%r');
SELECT TIME_FORMAT("25:00:00", '%r');
TIME_FORMAT("25:00:00", '%r')
TIME_FORMAT("25:00:00", '%r')
01:00:00 AM
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
mysql-test/t/date_formats.test
View file @
06d6b747
...
@@ -287,3 +287,14 @@ SELECT TIME_FORMAT("12:00:00", '%r');
...
@@ -287,3 +287,14 @@ SELECT TIME_FORMAT("12:00:00", '%r');
SELECT
TIME_FORMAT
(
"15:00:00"
,
'%r'
);
SELECT
TIME_FORMAT
(
"15:00:00"
,
'%r'
);
SELECT
TIME_FORMAT
(
"01:00:00"
,
'%r'
);
SELECT
TIME_FORMAT
(
"01:00:00"
,
'%r'
);
SELECT
TIME_FORMAT
(
"25: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'
);
sql/item_timefunc.cc
View file @
06d6b747
...
@@ -609,7 +609,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
...
@@ -609,7 +609,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
break
;
break
;
case
'l'
:
case
'l'
:
days_i
=
l_time
->
hour
/
24
;
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
;
length
=
int10_to_str
(
hours_i
,
intbuff
,
10
)
-
intbuff
;
str
->
append_with_prefill
(
intbuff
,
length
,
1
,
'0'
);
str
->
append_with_prefill
(
intbuff
,
length
,
1
,
'0'
);
break
;
break
;
...
...
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