diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-11-21 20:31:00 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-11-21 20:31:00 +0300 |
commit | a4bcf99f3846d77a958c66c7d418681d7e66d3da (patch) | |
tree | 4a4dd18b14394844bb4fcb09f4ab1495d88a62b2 /sql/item.cc | |
parent | 8c1dfab38dac38a4750d6251536b9725f597f7ef (diff) | |
download | mariadb-git-a4bcf99f3846d77a958c66c7d418681d7e66d3da.tar.gz |
Backport of the fix for bug #33969: Updating a text field via a
left join
When creating a temporary TEXT/BLOB field from an Item in
Item::make_string_field(), the field's type was unconditionally
set to the one corresponding to the maximum length (i.e.
LONGTEXT/ LONGBLOB). This resulted in problems when exactly the
same TEXT/BLOB is type required in cases like CREATE ... SELECT
or creating internal temporary tables for joins.
Fixed by calling a different constructor for Field_blob so that
an appropriate type is used depending on the Item's max_length
value.
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index b59a82f8045..f8fd82fda67 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5025,7 +5025,7 @@ Field *Item::make_string_field(TABLE *table) DBUG_ASSERT(collation.collation); if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB) field= new Field_blob(max_length, maybe_null, name, - collation.collation); + collation.collation, TRUE); /* Item_type_holder holds the exact type, do not change it */ else if (max_length > 0 && (type() != Item::TYPE_HOLDER || field_type() != MYSQL_TYPE_STRING)) |