summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorsergefp@mysql.com <>2005-02-04 09:14:22 +0300
committersergefp@mysql.com <>2005-02-04 09:14:22 +0300
commit38339e1c516f2c7d466c440f88013e5c92c40445 (patch)
treedf20fcb468895423bb135dd8c9ec93140e32963b /sql/item_cmpfunc.cc
parente87bd60c12452e5cac8cc72708de8ed222bbd066 (diff)
downloadmariadb-git-38339e1c516f2c7d466c440f88013e5c92c40445.tar.gz
Fix for BUG#7716: in in_string::set() take into account that the value returned
by item->val_str() may be a substring of the passed string. Disallow string=its_substring assignment in String::operator=().
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index c5e6d520ab7..46ef3281dd1 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1503,7 +1503,11 @@ void in_string::set(uint pos,Item *item)
String *str=((String*) base)+pos;
String *res=item->val_str(str);
if (res && res != str)
+ {
+ if (res->uses_buffer_owned_by(str))
+ res->copy();
*str= *res;
+ }
if (!str->charset())
{
CHARSET_INFO *cs;