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:
@ -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;
|
||||
|
Reference in New Issue
Block a user