summaryrefslogtreecommitdiff
path: root/sql/key.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/key.cc')
-rw-r--r--sql/key.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/key.cc b/sql/key.cc
index 8c7eab2a688..819b79879e8 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -360,12 +360,10 @@ void key_unpack(String *to,TABLE *table,uint idx)
if (field->binary() && field->type() == MYSQL_TYPE_STRING && tmp.length())
{
const char *tmp_end= tmp.ptr() + tmp.length();
- while (tmp_end > tmp.ptr() && !*--tmp_end);
+ while (tmp_end > tmp.ptr() && !*--tmp_end) ;
tmp.length(tmp_end - tmp.ptr() + 1);
}
- if (cs->mbmaxlen > 1 &&
- table->field[key_part->fieldnr - 1]->field_length !=
- key_part->length)
+ if (cs->mbmaxlen > 1 && (key_part->key_part_flag & HA_PART_KEY_SEG))
{
/*
Prefix key, multi-byte charset.