Skip to content
  • Xing Zhang's avatar
    15b71e78
    Bug#23752284 : STRCMP NOT CONSISTENT WITH ORDER BY FOR UTF8MB4_UNICODE_CI · 15b71e78
    Xing Zhang authored
    Cause:
    The nweights parameter of strnxfrm function means how many
    characters' weights are expected. But in the implementation of UCA
    4.0.0 and 5.2.0, it is read as how many weights are to return. It
    works well when one character has only one primary weight, but some
    characters have more than one, that causes wrong comparison result.
    For example, U+00DF's weight in DUCET 4.0.0 is:
    [.0FEA.0020.0004.00DF][.0000.015D.0004.00DF][.0FEA.0020.001F.00DF],
    which has 2 non-ignorable primary weights: 0FEA, 0FEA.
    In the reported case, U+33FC's weight in DUCET 4.0.0 is:
    [.0E2B.0020.0004.33FC][.0E32.0020.0004.33FC][.FB40.0020.001F.65E5]
    [.E5E5.0000.0000.65E5], which has 4 non-ignorable primary weights.
    
    Solution:
    Fix by adding counter of characters whose weights are expected.
    15b71e78
    Bug#23752284 : STRCMP NOT CONSISTENT WITH ORDER BY FOR UTF8MB4_UNICODE_CI
    Xing Zhang authored
    Cause:
    The nweights parameter of strnxfrm function means how many
    characters' weights are expected. But in the implementation of UCA
    4.0.0 and 5.2.0, it is read as how many weights are to return. It
    works well when one character has only one primary weight, but some
    characters have more than one, that causes wrong comparison result.
    For example, U+00DF's weight in DUCET 4.0.0 is:
    [.0FEA.0020.0004.00DF][.0000.015D.0004.00DF][.0FEA.0020.001F.00DF],
    which has 2 non-ignorable primary weights: 0FEA, 0FEA.
    In the reported case, U+33FC's weight in DUCET 4.0.0 is:
    [.0E2B.0020.0004.33FC][.0E32.0020.0004.33FC][.FB40.0020.001F.65E5]
    [.E5E5.0000.0000.65E5], which has 4 non-ignorable primary weights.
    
    Solution:
    Fix by adding counter of characters whose weights are expected.
Loading