Bug #71995 LDML collation size is limited
Submitted: 10 Mar 2014 15:56 Modified: 31 Mar 2014 13:36
Reporter: Александр Евстигнеев Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Charsets Severity:S2 (Serious)
Version:5.5.36, 5.5.37 OS:Windows (Win7, 64 bit, FreeBSD 9.2)
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: charset, collation, LDML, utf8

[10 Mar 2014 15:56] Александр Евстигнеев
It seems to me, that there is a very tight buffer for LDML collation instructions from Index.xml

When I defining just few rules, they works fine, but, if i'll add a lot of rules before, the lates stops working.

How to repeat:
My task was to force mysql to treat different variations of latin letters as different letters.

1) Insert collation into Index.xml (in utf8 section):

<collation name="utf8_test_ci" id="253">

2) Restart mySQL server
3) Execute query: 
"O" = "Ö" as n
,"O" collate utf8_test_ci = "Ö" as c;

| n | c |
| 1 | 0 |

Works fine!

4) Now replace collation part with a large block: 

<collation name="utf8_test_ci" id="253">

Restart mySQL server and try query again. Collation won't work. Also no error messages appears in server log or during query.

Some tests shows, that first rules works fine, but from some point their stops. It seems that mySQL reads some instructions and skips other.

Codes for testing can be checked here: 

Suggested fix:
Not sure how it works internally, but if there is a buffer, it should be increased. Drastically.
[11 Mar 2014 8:52] Hartmut Holzgraefe
It worked fine for me when I created "Unicode distinct case-insensitive" which is a pretty big one:



You may be running into one of these though:

* Bug #65593 "parse errors in loadable UCA / LDML collations are silently ignored"

* bug #68142 "UCA / LDML parser does not complain about invalid/unsupported backslash sequence"

* bug #68143 "Validity of LDML collations is checked too late"

* bug #68144 "Collation name missing from log messages about LDML definition problems"
[11 Mar 2014 11:18] Александр Евстигнеев
Looks like you are right, but need to do some additional testing. 

In case you are right, there is a mistake in my LDML data, which prevents it from parsing from some position. Is there any way to find and fix it? I've checked manually and found nothing...
[15 Mar 2014 11:49] Александр Евстигнеев
UTF text file to define characters ordering

Attachment: utfsource.txt (text/plain), 475 bytes.

[15 Mar 2014 11:50] Александр Евстигнеев
Ruleset, generated from UTF source file

Attachment: rules.txt (text/plain), 3.33 KiB.

[15 Mar 2014 12:00] Александр Евстигнеев
Collation testing query

Attachment: test.sql (application/octet-stream, text), 19.99 KiB.

[15 Mar 2014 12:01] Александр Евстигнеев
Ok, i've done some additional testings and research.

1) Your huge collation file from 
not working in version i've specified. 
Tested on Windows 7 64-bits. 
Symptoms are the same.

2) I wrote a little script in Perl that converts file like:


To the rules for collation files. Here is what i've got:


(in my case collation named utf_test_ci and have id = 253)

So it's pretty correct and there are no human mistakes.

Also i've wrote a script, that generates a test query from the same file:


What we have:

It seems that only first 96 rules are working fine. Others are ignored.

If you comment few 20 rules without breaking format, you'll see that next 20 rules will start working.

So now i'm really sure about kinda buffering problem or rules number limit.
[15 Mar 2014 12:32] Александр Евстигнеев
Tested this collation section with mySQL 5.6.16 - Works great, so it's defenitely a problem of 5.5.36
[15 Mar 2014 12:34] Александр Евстигнеев
Ocassionaly changed version and OSes of original ticket. Sorry.
[17 Mar 2014 20:14] Sveta Smirnova
Thank you for the report.

Verified as described. Version 5.6 is not affected.
[31 Mar 2014 13:36] Georgi Kodinov
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at


Fixed in 5.6 by WL#2673 and WL#5624. Pleae consider upgrading to 5.6