1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-16729 VARCHAR COMPRESSED is created with a wrong length for multi-byte character sets

Field_varstring::sql_type() did not calculate character length correctly.
Using char_length() instead of the bad code.
This commit is contained in:
Alexander Barkov
2018-07-24 13:19:31 +04:00
parent a86a02a844
commit f74d2a9faa
3 changed files with 27 additions and 3 deletions

View File

@ -1472,3 +1472,17 @@ SELECT LEFT(a, 10), LENGTH(a) FROM t1;
LEFT(a, 10) LENGTH(a)
aaaaaaaaaa 255
DROP TABLE t1;
#
# MDEV-16729 VARCHAR COMPRESSED is created with a wrong length for multi-byte character sets
#
CREATE OR REPLACE TABLE t1 (a VARCHAR(1000) CHARACTER SET utf8 COMPRESSED);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
COLUMN_TYPE
varchar(1000) /*!100301 COMPRESSED*/
DROP TABLE t1;