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
53cf8914
Commit
53cf8914
authored
Sep 20, 2008
by
Kristofer Pettersson
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.0-bugteam -> 5.1-bugteam
parents
ba93a357
cd9aef82
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
2 deletions
+48
-2
mysql-test/r/sp.result
mysql-test/r/sp.result
+10
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+18
-0
sql/field.cc
sql/field.cc
+11
-1
sql/field.h
sql/field.h
+9
-1
No files found.
mysql-test/r/sp.result
View file @
53cf8914
...
...
@@ -6836,6 +6836,16 @@ drop procedure p1;
drop function f1;
drop view v1;
drop table t1;
drop procedure if exists `p2` $
create procedure `p2`(in `a` text charset utf8)
begin
declare `pos` int default 1;
declare `str` text charset utf8;
set `str` := `a`;
select substr(`str`, `pos`+ 1 ) into `str`;
end $
call `p2`('s s s s s s');
drop procedure `p2`;
# ------------------------------------------------------------------
# -- End of 5.0 tests
# ------------------------------------------------------------------
...
...
mysql-test/t/sp.test
View file @
53cf8914
...
...
@@ -8023,6 +8023,24 @@ drop function f1;
drop view v1;
drop table t1;
#
# Bug#38469 invalid memory read and/or crash with utf8 text field, stored procedure, uservar
#
delimiter $;
--disable_warnings
drop procedure if exists `
p2
` $
--enable_warnings
create procedure `
p2
`(in `
a
` text charset utf8)
begin
declare `
pos
` int default 1;
declare `
str
` text charset utf8;
set `
str
` := `
a
`;
select substr(`
str
`, `
pos
`+ 1 ) into `
str
`;
end $
delimiter ;$
call `
p2
`('s s s s s s');
drop procedure `
p2
`
;
--
echo
# ------------------------------------------------------------------
--
echo
# -- End of 5.0 tests
--
echo
# ------------------------------------------------------------------
...
...
sql/field.cc
View file @
53cf8914
...
...
@@ -7699,8 +7699,18 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
return
0
;
}
if
(
from
==
value
.
ptr
())
/*
If the 'from' address is in the range of the temporary 'value'-
object we need to copy the content to a different location or it will be
invalidated when the 'value'-object is reallocated to make room for
the new character set.
*/
if
(
from
>=
value
.
ptr
()
&&
from
<=
value
.
ptr
()
+
value
.
length
())
{
/*
If content of the 'from'-address is cached in the 'value'-object
it is possible that the content needs a character conversion.
*/
uint32
dummy_offset
;
if
(
!
String
::
needs_conversion
(
length
,
cs
,
field_charset
,
&
dummy_offset
))
{
...
...
sql/field.h
View file @
53cf8914
...
...
@@ -1597,8 +1597,16 @@ class Field_varstring :public Field_longstr {
class
Field_blob
:
public
Field_longstr
{
protected:
/**
The number of bytes used to represent the length of the blob.
*/
uint
packlength
;
String
value
;
// For temporaries
/**
The 'value'-object is a cache fronting the storage engine.
*/
String
value
;
public:
Field_blob
(
uchar
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
...
...
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