summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 692f123097a..88816151c10 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1053,6 +1053,7 @@ void Field_str::make_field(Send_field *field)
uint Field::fill_cache_field(CACHE_FIELD *copy)
{
+ uint store_length;
copy->str=ptr;
copy->length=pack_length();
copy->blob_field=0;
@@ -1065,10 +1066,16 @@ uint Field::fill_cache_field(CACHE_FIELD *copy)
}
else if (!zero_pack() && (type() == FIELD_TYPE_STRING && copy->length > 4 ||
type() == FIELD_TYPE_VAR_STRING))
+ {
copy->strip=1; /* Remove end space */
+ store_length= 2;
+ }
else
+ {
copy->strip=0;
- return copy->length+(int) copy->strip;
+ store_length= 0;
+ }
+ return copy->length+ store_length;
}