Bug #85375 Remove special-casing of non-strnxfrm-based collations
Submitted: 8 Mar 2017 14:51 Modified: 15 Mar 2017 16:04
Reporter: Steinar Gunderson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:8.0.2 OS:Any
Assigned to: CPU Architecture:Any

[8 Mar 2017 14:51] Steinar Gunderson
Description:
Some character sets are designated as MY_CS_STRNXFRM, meaning that sorting needs to go through my_strnxfrm() (implemented by the charset), and some are not, meaning that a client can do the strnxfrm itself based on cs->sort_order. However, most of the logic related to the latter has been removed already (e.g. filesort always uses my_strnxfrm() since 2003), and now it's mostly in the way. The three main uses left are:

 1. A microoptimization for constructing sort keys in filesort.
 2. A home-grown implementation of Boyer-Moore for accelerating certain LIKE patterns that should probably be handled through FTS.
 3. Some optimizations to MyISAM prefix keys.

Given that our default collation (utf8mb4_0900_ai_ci) now is a strnxfrm-based collation, the benefits of keeping these around for a narrow range of single-byte locales (like latin1_swedish_ci, cp850 and a bunch of more obscure locales) seems dubious. We seemingly can't remove the flag entirely due to #3 seemingly affecting the on-disk MyISAM structure, but we can remove the code for #1 and #2.

How to repeat:
N/A

Suggested fix:
N/A
[15 Mar 2017 16:04] Paul DuBois
Posted by developer:
 
Fixed in 8.0.2.

Code cleanup. No changelog entry needed.