RuleBasedCollator does not handle 'reorder other digit' well

Description

Generate posix locale data from CLDR(28) fails for cs_CZ@collation=digits-after because NullException in com.ibm.icu.dev.util.SortedBag. The root cause is that TreeMap can not find own key if RuleBasedCollator rules contain `[others digit|reorder]`

The code demonstrate the issue (the assertion fails):

Activity

Show:
TracBot
June 30, 2018, 11:42 PM
Trac Comment 1 by jan.lana@96b2f16665ff96ba—2016-04-28T14:10:53.473Z

maybe related issue: #11388

jehan-guillaume de Rorthais
June 9, 2020, 8:26 PM

Hi,

We hit this bug while trying to reorder digit using fr-u-kr-latn-digit in PostgreSQL. It seems the bug is related to ucol_strcoll() function family. ucol_getSortKey seem safe.

Here is a patch to add a testcase demonstrating this:

Should I create a pull request on github?

jehan-guillaume de Rorthais
June 9, 2020, 9:37 PM

By the way, this patch and test was done on current HEAD.

For the record, here is the output of the test:

jehan-guillaume de Rorthais
June 9, 2020, 10:33 PM

Last one for today: I forgot to mention the bug vanish when using: fr-u-kr-latn-digit-kn.

Here is the (old) discussion on pgsql-bugs mailing list: https://www.postgresql.org/message-id/flat/153201618542.1404.3611626898935613264%40wrigleys.postgresql.org

Assignee

Markus Scherer

Reporter

TracBot

Components

Labels

None

Reviewer

None

Priority

major

Time Needed

Hours

Fix versions

Configure