summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-09 11:27:40 +0100
committerSergei Golubchik <serg@mariadb.org>2016-02-09 11:27:40 +0100
commitf3444df4153ccbb9ea8db73c1b5de6d7aa6d1334 (patch)
tree76c059c29ec0caca19a62dbcbe8efcd22e697692 /sql/field_conv.cc
parentc4cb24006139bb6a619ca9d6b00d00c2275d2c28 (diff)
parent93a6142dd0c0c8b2e0683e4d57082582eac91fdb (diff)
downloadmariadb-git-f3444df4153ccbb9ea8db73c1b5de6d7aa6d1334.tar.gz
Merge branch 'mysql/5.5' into 5.5
reverted about half of commits as either not applicable or outright wrong
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 3fdc1639266..5781f1da576 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -1,6 +1,5 @@
-/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2016, 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
@@ -856,7 +855,12 @@ int field_conv(Field *to,Field *from)
Field_blob *blob=(Field_blob*) to;
from->val_str(&blob->value);
- if (!blob->value.is_alloced() && from->is_updatable())
+ /*
+ Copy value if copy_blobs is set, or source is part of the table's
+ writeset.
+ */
+ if (to->table->copy_blobs ||
+ (!blob->value.is_alloced() && from->is_updatable()))
blob->value.copy();
return blob->store(blob->value.ptr(),blob->value.length(),from->charset());