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
e9b005ea
Commit
e9b005ea
authored
Oct 25, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/14016-bug-4.1-mysql
parents
f63c5a07
0b2efd3d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+8
-0
mysql-test/t/date_formats.test
mysql-test/t/date_formats.test
+8
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+10
-0
No files found.
mysql-test/r/date_formats.result
View file @
e9b005ea
...
...
@@ -456,3 +456,11 @@ f1 f2
Warnings:
Warning 1292 Truncated incorrect date value: '2003-04-05 g'
Warning 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567'
create table t1 (f1 datetime);
insert into t1 (f1) values ("2005-01-01");
insert into t1 (f1) values ("2005-02-01");
select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
d1 d2
02 February
01 January
drop table t1;
mysql-test/t/date_formats.test
View file @
e9b005ea
...
...
@@ -260,4 +260,12 @@ select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
str_to_date
(
"2003-04-05 10:11:12.101010234567"
,
"%Y-%m-%d %H:%i:%S.%f"
)
as
f2
;
--
enable_ps_protocol
#
# Bug #14016
#
create
table
t1
(
f1
datetime
);
insert
into
t1
(
f1
)
values
(
"2005-01-01"
);
insert
into
t1
(
f1
)
values
(
"2005-02-01"
);
select
date_format
(
f1
,
"%m"
)
as
d1
,
date_format
(
f1
,
"%M"
)
as
d2
from
t1
order
by
date_format
(
f1
,
"%M"
);
drop
table
t1
;
# End of 4.1 tests
sql/item_timefunc.cc
View file @
e9b005ea
...
...
@@ -1528,6 +1528,16 @@ void Item_func_date_format::fix_length_and_dec()
if
(
args
[
1
]
->
type
()
==
STRING_ITEM
)
{
// Optimize the normal case
fixed_length
=
1
;
/*
Force case sensitive collation on format string.
This needed because format modifiers with different case,
for example %m and %M, have different meaning. Thus eq()
will distinguish them.
*/
args
[
1
]
->
collation
.
set
(
get_charset_by_csname
(
args
[
1
]
->
collation
.
collation
->
csname
,
MY_CS_BINSORT
,
MYF
(
0
)),
DERIVATION_COERCIBLE
);
/*
The result is a binary string (no reason to use collation->mbmaxlen
This is becasue make_date_time() only returns binary strings
...
...
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