diff options
author | Kristofer Pettersson <kpettersson@mysql.com> | 2008-09-20 16:52:34 +0200 |
---|---|---|
committer | Kristofer Pettersson <kpettersson@mysql.com> | 2008-09-20 16:52:34 +0200 |
commit | 153e8e7c0774cf617c48f23f83e14abd9ccc7f83 (patch) | |
tree | b5caadc16a24fa605d85a84463ed472803330eaf /sql/field.cc | |
parent | 88ec0a0ce8d1460377de9971e6df003e5a58371f (diff) | |
parent | 119c5aaeba2b35f201bdbd98c0714be9b6a780fb (diff) | |
download | mariadb-git-153e8e7c0774cf617c48f23f83e14abd9ccc7f83.tar.gz |
Merge 5.0-bugteam -> 5.1-bugteam
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc index b03cc140ade..16bf0fdb070 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -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)) { |