diff options
author | unknown <kostja@bodhi.local> | 2006-07-15 01:04:51 +0400 |
---|---|---|
committer | unknown <kostja@bodhi.local> | 2006-07-15 01:04:51 +0400 |
commit | 5677612aea6098001846c128dcefc357a013c171 (patch) | |
tree | 06e46da942509b2dbfc21491adfe0fd8a3ec7db0 /sql/field_conv.cc | |
parent | 906cd90d936e384af54c1f4e75ebb56bd2f6b148 (diff) | |
parent | 4c2db1bef100a1159f65d3fad0ec764727198e58 (diff) | |
download | mariadb-git-5677612aea6098001846c128dcefc357a013c171.tar.gz |
Merge bodhi.local:/opt/local/work/tmp_merge
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/sp-vars.result:
Auto merged
mysql-test/t/func_sapdb.test:
Auto merged
mysql-test/t/func_time.test:
Auto merged
sql/field_conv.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
mysql-test/r/information_schema.result:
Use local
mysql-test/t/information_schema.test:
Manual merge.
sql/sql_lex.h:
Manual merge.
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; |