summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-10-08 22:54:24 +0200
committerSergei Golubchik <serg@mariadb.org>2015-10-08 22:54:24 +0200
commit82e9f6d948132b71abd57d8413f97f0cc2208d82 (patch)
tree3ab146f819af46d42d93be133cea16b66ff5df7f /sql/field_conv.cc
parentc8d511293aae155210089b6de4143d11569af18d (diff)
parentb9768521bdeb1a8069c7b871f4536792b65fd79b (diff)
downloadmariadb-git-82e9f6d948132b71abd57d8413f97f0cc2208d82.tar.gz
Merge remote-tracking branch 'mysql/5.5' into 5.5
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index d6a53a9a2fc..d24f31e4fa1 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -1,7 +1,6 @@
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2010, 2012, Monty Program Ab
-
+ Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -863,15 +862,10 @@ int field_conv(Field *to,Field *from)
{ // Be sure the value is stored
Field_blob *blob=(Field_blob*) to;
from->val_str(&blob->value);
- /*
- 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))
+
+ if (!blob->value.is_alloced() && from->is_updatable())
blob->value.copy();
+
return blob->store(blob->value.ptr(),blob->value.length(),from->charset());
}
if (from->real_type() == MYSQL_TYPE_ENUM &&