[MDEV-24335] Unexpected question mark in the end of a TINYTEXT column Created: 2020-12-02  Updated: 2021-11-08  Resolved: 2021-11-02

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.2.42, 10.3.33, 10.4.23, 10.5.14, 10.6.6, 10.7.2

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

The problem is repeatable with all versions from 10.2 to 10.7.

CREATE OR REPLACE TABLE t1 (a TINYTEXT character set utf8) engine=myisam default charset=utf8;
INSERT IGNORE INTO t1 VALUES (REPEAT(_utf8 0xD184, 250));
SELECT LENGTH(a), CHAR_LENGTH(a), RIGHT(a,3) FROM t1;

+-----------+----------------+------------+
| LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
+-----------+----------------+------------+
|       255 |            128 | фф?        |
+-----------+----------------+------------+

Looks wrong. There should not be ? at the end. The expected result is:

+-----------+----------------+------------+
| LENGTH(a) | CHAR_LENGTH(a) | RIGHT(a,3) |
+-----------+----------------+------------+
|       254 |            127 | ффф        |
+-----------+----------------+------------+


Generated at Thu Feb 08 09:29:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.