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
b5586c67
Commit
b5586c67
authored
Nov 22, 2010
by
Guilhem Bichot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug#56138 "valgrind errors about overlapping memory when double-assigning same variable",
and related small fixes.
parent
871930e7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
8 deletions
+19
-8
mysql-test/r/user_var.result
mysql-test/r/user_var.result
+3
-0
mysql-test/t/user_var.test
mysql-test/t/user_var.test
+7
-0
sql/field_conv.cc
sql/field_conv.cc
+2
-5
sql/item_func.cc
sql/item_func.cc
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+6
-2
No files found.
mysql-test/r/user_var.result
View file @
b5586c67
...
@@ -447,4 +447,7 @@ IF(
...
@@ -447,4 +447,7 @@ IF(
count(*), 1)
count(*), 1)
1
1
DROP TABLE t1;
DROP TABLE t1;
select @v:=@v:=sum(1) from dual;
@v:=@v:=sum(1)
1
End of 5.1 tests
End of 5.1 tests
mysql-test/t/user_var.test
View file @
b5586c67
...
@@ -346,4 +346,11 @@ FROM t1 GROUP BY a LIMIT 1;
...
@@ -346,4 +346,11 @@ FROM t1 GROUP BY a LIMIT 1;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# BUG#56138 "valgrind errors about overlapping memory when
# double-assigning same variable"
#
select
@
v
:=@
v
:=
sum
(
1
)
from
dual
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/field_conv.cc
View file @
b5586c67
...
@@ -786,11 +786,8 @@ int field_conv(Field *to,Field *from)
...
@@ -786,11 +786,8 @@ int field_conv(Field *to,Field *from)
((
Field_varstring
*
)
from
)
->
length_bytes
==
((
Field_varstring
*
)
from
)
->
length_bytes
==
((
Field_varstring
*
)
to
)
->
length_bytes
))
((
Field_varstring
*
)
to
)
->
length_bytes
))
{
// Identical fields
{
// Identical fields
#ifdef HAVE_purify
// to->ptr==from->ptr may happen if one does 'UPDATE ... SET x=x'
/* This may happen if one does 'UPDATE ... SET x=x' */
memmove
(
to
->
ptr
,
from
->
ptr
,
to
->
pack_length
());
if
(
to
->
ptr
!=
from
->
ptr
)
#endif
memcpy
(
to
->
ptr
,
from
->
ptr
,
to
->
pack_length
());
return
0
;
return
0
;
}
}
}
}
...
...
sql/item_func.cc
View file @
b5586c67
...
@@ -3920,7 +3920,7 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length,
...
@@ -3920,7 +3920,7 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length,
length
--
;
// Fix length change above
length
--
;
// Fix length change above
entry
->
value
[
length
]
=
0
;
// Store end \0
entry
->
value
[
length
]
=
0
;
// Store end \0
}
}
mem
cpy
(
entry
->
value
,
ptr
,
length
);
mem
move
(
entry
->
value
,
ptr
,
length
);
if
(
type
==
DECIMAL_RESULT
)
if
(
type
==
DECIMAL_RESULT
)
((
my_decimal
*
)
entry
->
value
)
->
fix_buffer_pointer
();
((
my_decimal
*
)
entry
->
value
)
->
fix_buffer_pointer
();
entry
->
length
=
length
;
entry
->
length
=
length
;
...
...
sql/sql_select.cc
View file @
b5586c67
...
@@ -4034,8 +4034,12 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
...
@@ -4034,8 +4034,12 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
continue
;
continue
;
}
}
#ifdef HAVE_purify
#if defined(__GNUC__) && !MY_GNUC_PREREQ(4,4)
/* Valgrind complains about overlapped memcpy when save_pos==use. */
/*
Old gcc used a memcpy(), which is undefined if save_pos==use:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19410
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39480
*/
if
(
save_pos
!=
use
)
if
(
save_pos
!=
use
)
#endif
#endif
*
save_pos
=
*
use
;
*
save_pos
=
*
use
;
...
...
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