diff options
author | kostja@bodhi.local <> | 2006-07-15 01:04:51 +0400 |
---|---|---|
committer | kostja@bodhi.local <> | 2006-07-15 01:04:51 +0400 |
commit | f536f361d9f570b84bdbcc633d9ac61b195d785f (patch) | |
tree | 06e46da942509b2dbfc21491adfe0fd8a3ec7db0 /sql/field_conv.cc | |
parent | 2834bc1eae46e7a53fa06cfbd9c4dc7ebf80c2f4 (diff) | |
parent | 1c4dffc8cae85c20c2359ac6afcc8abf8a158a75 (diff) | |
download | mariadb-git-f536f361d9f570b84bdbcc633d9ac61b195d785f.tar.gz |
Merge bodhi.local:/opt/local/work/tmp_merge
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r-- | sql/field_conv.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 3eab782d167..20d1e372a2c 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -674,9 +674,14 @@ void field_conv(Field *to,Field *from) { // Be sure the value is stored Field_blob *blob=(Field_blob*) to; from->val_str(&blob->value); - if (!blob->value.is_alloced() && - from->real_type() != MYSQL_TYPE_STRING && - from->real_type() != MYSQL_TYPE_VARCHAR) + /* + Copy value if copy_blobs is set, or source is not a string and + we have a pointer to its internal string conversion buffer. + */ + if (to->table->copy_blobs || + (!blob->value.is_alloced() && + from->real_type() != MYSQL_TYPE_STRING && + from->real_type() != MYSQL_TYPE_VARCHAR)) blob->value.copy(); blob->store(blob->value.ptr(),blob->value.length(),from->charset()); return; |