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
efe8743b
Commit
efe8743b
authored
Nov 12, 2010
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merging from mysql-5.1-security
parents
324cb458
0e1c167e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
+37
-7
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+14
-0
mysql-test/t/date_formats.test
mysql-test/t/date_formats.test
+16
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+7
-7
No files found.
mysql-test/r/date_formats.result
View file @
efe8743b
...
@@ -544,3 +544,17 @@ SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
...
@@ -544,3 +544,17 @@ SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
valid_date
valid_date
Thursday 01 January 2009
Thursday 01 January 2009
"End of 5.0 tests"
"End of 5.0 tests"
#
# Start of 5.1 tests
#
#
# Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
#
SET NAMES utf8;
SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)));
LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)))
%
SET NAMES latin1;
#
# End of 5.1 tests
#
mysql-test/t/date_formats.test
View file @
efe8743b
...
@@ -354,3 +354,19 @@ SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
...
@@ -354,3 +354,19 @@ SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
SELECT
DATE_FORMAT
(
"2009-01-01"
,
'%W %d %M %Y'
)
as
valid_date
;
SELECT
DATE_FORMAT
(
"2009-01-01"
,
'%W %d %M %Y'
)
as
valid_date
;
--
echo
"End of 5.0 tests"
--
echo
"End of 5.0 tests"
--
echo
#
--
echo
# Start of 5.1 tests
--
echo
#
--
echo
#
--
echo
# Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
--
echo
#
SET
NAMES
utf8
;
SELECT
LEAST
(
'%'
,
GET_FORMAT
(
datetime
,
'eur'
),
CAST
(
GET_FORMAT
(
datetime
,
'eur'
)
AS
CHAR
(
65535
)));
SET
NAMES
latin1
;
--
echo
#
--
echo
# End of 5.1 tests
--
echo
#
sql/item_timefunc.cc
View file @
efe8743b
...
@@ -2526,14 +2526,14 @@ String *Item_char_typecast::val_str(String *str)
...
@@ -2526,14 +2526,14 @@ String *Item_char_typecast::val_str(String *str)
{
{
// Convert character set if differ
// Convert character set if differ
uint
dummy_errors
;
uint
dummy_errors
;
if
(
!
(
res
=
args
[
0
]
->
val_str
(
&
tmp_value
))
||
if
(
!
(
res
=
args
[
0
]
->
val_str
(
str
))
||
str
->
copy
(
res
->
ptr
(),
res
->
length
(),
from_cs
,
tmp_value
.
copy
(
res
->
ptr
(),
res
->
length
(),
from_cs
,
cast_cs
,
&
dummy_errors
))
cast_cs
,
&
dummy_errors
))
{
{
null_value
=
1
;
null_value
=
1
;
return
0
;
return
0
;
}
}
res
=
str
;
res
=
&
tmp_value
;
}
}
res
->
set_charset
(
cast_cs
);
res
->
set_charset
(
cast_cs
);
...
@@ -2568,9 +2568,9 @@ String *Item_char_typecast::val_str(String *str)
...
@@ -2568,9 +2568,9 @@ String *Item_char_typecast::val_str(String *str)
{
{
if
(
res
->
alloced_length
()
<
(
uint
)
cast_length
)
if
(
res
->
alloced_length
()
<
(
uint
)
cast_length
)
{
{
str
->
alloc
(
cast_length
);
str
_value
.
alloc
(
cast_length
);
str
->
copy
(
*
res
);
str
_value
.
copy
(
*
res
);
res
=
str
;
res
=
&
str_value
;
}
}
bzero
((
char
*
)
res
->
ptr
()
+
res
->
length
(),
bzero
((
char
*
)
res
->
ptr
()
+
res
->
length
(),
(
uint
)
cast_length
-
res
->
length
());
(
uint
)
cast_length
-
res
->
length
());
...
...
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