[MDEV-23216] LONGTEXT column with collation doesn't sort Created: 2020-07-19  Updated: 2020-07-24  Resolved: 2020-07-23

Status: Closed
Project: MariaDB Server
Component/s: Character Sets, Optimizer
Affects Version/s: 10.5.4
Fix Version/s: 10.5.5

Type: Bug Priority: Critical
Reporter: Toni Viemerö Assignee: Varun Gupta (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

mariadb:10.5 docker image


Attachments: Text File collate_text.sql    

 Description   

Creating a table with a LONGTEXT column with COLLATE doesn't sort properly.
Using TEXT or dropping COLLATE working as expected. Also working on 10.4.

CREATE TABLE t (
 c LONGTEXT COLLATE utf8mb4_swedish_ci
);
INSERT INTO t (c) VALUES ('A'),('Z'),('B'),('Y');
SELECT * FROM t ORDER BY c ASC;

Result:
A,Z,B,Y

Expected:
A,B,Y,Z



 Comments   
Comment by Alexander Barkov [ 2020-07-24 ]

The patch https://github.com/MariaDB/server/commit/f4451a0ff13a13e8899806e92df9301412f41da8 is OK to push.

Just one note: consider adding a test with ORDER BY..DESC for even better coverage.

Thanks.

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