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
324cb458
Commit
324cb458
authored
Nov 11, 2010
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merging from mysql-5.1-security
parents
0c4e115c
771137b5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
3 deletions
+50
-3
mysql-test/r/ctype_ujis.result
mysql-test/r/ctype_ujis.result
+10
-0
mysql-test/r/xml.result
mysql-test/r/xml.result
+13
-0
mysql-test/t/ctype_ujis.test
mysql-test/t/ctype_ujis.test
+7
-0
mysql-test/t/xml.test
mysql-test/t/xml.test
+11
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+7
-1
sql/item_xmlfunc.cc
sql/item_xmlfunc.cc
+2
-2
No files found.
mysql-test/r/ctype_ujis.result
View file @
324cb458
...
@@ -2374,6 +2374,16 @@ hex(convert(_latin1 0xA4A2 using ujis)) hex(c2)
...
@@ -2374,6 +2374,16 @@ hex(convert(_latin1 0xA4A2 using ujis)) hex(c2)
DROP PROCEDURE sp1;
DROP PROCEDURE sp1;
DROP TABLE t1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t2;
#
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
#
SET NAMES utf8;
SELECT CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis);
CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis)
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'a'
Warning 1292 Truncated incorrect INTEGER value: 'a'
set names default;
set names default;
set character_set_database=default;
set character_set_database=default;
set character_set_server=default;
set character_set_server=default;
...
...
mysql-test/r/xml.result
View file @
324cb458
...
@@ -1093,4 +1093,17 @@ Warnings:
...
@@ -1093,4 +1093,17 @@ Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
DROP TABLE t1;
DROP TABLE t1;
#
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
#
SET NAMES utf8;
SELECT REPLACE(EXTRACTVALUE('1', '/a'),'ds','');
REPLACE(EXTRACTVALUE('1', '/a'),'ds','')
#
# Bug #57820 extractvalue crashes
#
SELECT AVG(DISTINCT EXTRACTVALUE((''),('$@k')));
AVG(DISTINCT EXTRACTVALUE((''),('$@k')))
NULL
End of 5.1 tests
End of 5.1 tests
mysql-test/t/ctype_ujis.test
View file @
324cb458
...
@@ -1209,6 +1209,13 @@ DROP PROCEDURE sp1;
...
@@ -1209,6 +1209,13 @@ DROP PROCEDURE sp1;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
--
echo
#
--
echo
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
--
echo
#
SET
NAMES
utf8
;
SELECT
CONVERT
(
REPLACE
(
EXPORT_SET
(
'a'
,
'a'
,
'a'
,
''
,
'a'
),
'00'
,
''
)
USING
ujis
);
set
names
default
;
set
names
default
;
set
character_set_database
=
default
;
set
character_set_database
=
default
;
set
character_set_server
=
default
;
set
character_set_server
=
default
;
...
...
mysql-test/t/xml.test
View file @
324cb458
...
@@ -617,4 +617,15 @@ FROM t1 ORDER BY t1.id;
...
@@ -617,4 +617,15 @@ FROM t1 ORDER BY t1.id;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
--
echo
#
SET
NAMES
utf8
;
SELECT
REPLACE
(
EXTRACTVALUE
(
'1'
,
'/a'
),
'ds'
,
''
);
--
echo
#
--
echo
# Bug #57820 extractvalue crashes
--
echo
#
SELECT
AVG
(
DISTINCT
EXTRACTVALUE
((
''
),(
'$@k'
)));
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/item_strfunc.cc
View file @
324cb458
...
@@ -1080,9 +1080,15 @@ String *Item_func_replace::val_str(String *str)
...
@@ -1080,9 +1080,15 @@ String *Item_func_replace::val_str(String *str)
search
=
res2
->
ptr
();
search
=
res2
->
ptr
();
search_end
=
search
+
from_length
;
search_end
=
search
+
from_length
;
redo:
redo:
DBUG_ASSERT
(
res
->
ptr
()
||
!
offset
);
ptr
=
res
->
ptr
()
+
offset
;
ptr
=
res
->
ptr
()
+
offset
;
strend
=
res
->
ptr
()
+
res
->
length
();
strend
=
res
->
ptr
()
+
res
->
length
();
end
=
strend
-
from_length
+
1
;
/*
In some cases val_str() can return empty string
with ptr() == NULL and length() == 0.
Let's check strend to avoid overflow.
*/
end
=
strend
?
strend
-
from_length
+
1
:
NULL
;
while
(
ptr
<
end
)
while
(
ptr
<
end
)
{
{
if
(
*
ptr
==
*
search
)
if
(
*
ptr
==
*
search
)
...
...
sql/item_xmlfunc.cc
View file @
324cb458
...
@@ -2798,12 +2798,12 @@ String *Item_func_xml_extractvalue::val_str(String *str)
...
@@ -2798,12 +2798,12 @@ String *Item_func_xml_extractvalue::val_str(String *str)
null_value
=
0
;
null_value
=
0
;
if
(
!
nodeset_func
||
if
(
!
nodeset_func
||
!
(
res
=
args
[
0
]
->
val_str
(
str
))
||
!
(
res
=
args
[
0
]
->
val_str
(
str
))
||
!
parse_xml
(
res
,
&
pxml
))
!
parse_xml
(
res
,
&
pxml
)
||
!
(
res
=
nodeset_func
->
val_str
(
&
tmp_value
)))
{
{
null_value
=
1
;
null_value
=
1
;
return
0
;
return
0
;
}
}
res
=
nodeset_func
->
val_str
(
&
tmp_value
);
return
res
;
return
res
;
}
}
...
...
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