summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorbar@mysql.com <>2005-01-21 16:49:20 +0400
committerbar@mysql.com <>2005-01-21 16:49:20 +0400
commit2f6e0864ad0039cad473e028cade2095d45fe699 (patch)
tree0eec39b05fc476406d8e0cd1fc4c177c48e65efd /sql/sql_show.cc
parente0df86cd357e92215ac78c5563d1cafd217fae9a (diff)
downloadmariadb-git-2f6e0864ad0039cad473e028cade2095d45fe699.tar.gz
Bug#7943: Wrong prefix lengths reported on UTF-8 columns
SHOW KEYS FROM t1 now displays number of characters in Sub_part, not number of bytes, to be compatible with SHOW CREATE TABLE.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 8929872c466..91cac29f3a3 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1025,7 +1025,8 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
/* Check if we have a key part that only uses part of the field */
if (!(key_info->flags & HA_FULLTEXT) && (!key_part->field ||
key_part->length != table->field[key_part->fieldnr-1]->key_length()))
- protocol->store_tiny((longlong) key_part->length);
+ protocol->store_tiny((longlong) key_part->length /
+ key_part->field->charset()->mbmaxlen);
else
protocol->store_null();
protocol->store_null(); // No pack_information yet