diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-05-10 19:30:43 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-05-10 19:30:43 +0400 |
commit | 33721d91389759a917463a044fbd6f0b7654d629 (patch) | |
tree | adcd00a7c8dfb5230f7d6616ea58e18e078519cd /sql/field.h | |
parent | fc63c1e17ac040bb295aecf46d53f163efc97688 (diff) | |
download | mariadb-git-33721d91389759a917463a044fbd6f0b7654d629.tar.gz |
MDEV-16134 Wrong I_S.COLUMNS.CHARACTER_XXX_LENGTH value for compressed columns
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h index 50ee5b7784d..baed1511837 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1737,7 +1737,7 @@ public: Information_schema_character_attributes information_schema_character_attributes() const { - return Information_schema_character_attributes(field_length, + return Information_schema_character_attributes(max_display_length(), char_length()); } friend class Create_field; @@ -3448,6 +3448,10 @@ private: str.append(STRING_WITH_LEN(" /*!100301 COMPRESSED*/")); } uint32 max_display_length() const { return field_length - 1; } + uint32 char_length() const + { + return (field_length - 1) / field_charset->mbmaxlen; + } int cmp_max(const uchar *a_ptr, const uchar *b_ptr, uint max_len); /* |