1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +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

@ -170,3 +170,14 @@ CREATE TABLE t1(a TINYTEXT COMPRESSED);
INSERT INTO t1 VALUES(REPEAT('a', 255));
SELECT LEFT(a, 10), LENGTH(a) FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-16729 VARCHAR COMPRESSED is created with a wrong length for multi-byte character sets
--echo #
CREATE OR REPLACE TABLE t1 (a VARCHAR(1000) CHARACTER SET utf8 COMPRESSED);
SHOW CREATE TABLE t1;
SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DROP TABLE t1;