Skip to content
  • Knut Anders Hatlen's avatar
    f37b1fd1
    Bug#30350111: UTF8MB4_0900_BIN STRINGS CANNOT BE COMPARED WITH · f37b1fd1
    Knut Anders Hatlen authored
                  UTF8MB4_0900_AI_CI STRINGS
    
    The utf8mb4_0900_bin collation does not behave like other binary
    collations when it's mixed with non-binary collations. According to
    the documentation: "For an operation with operands from the same
    character set but that mix a _bin collation and a _ci or _cs
    collation, the _bin collation is used." But when mixing
    utf8mb4_0900_bin and for example utf8mb4_0900_ai_ci, the _bin
    collation is not preferred, and an error about illegal mix of
    collations is raised.
    
    This patch makes some changes to the collation aggregation to make
    utf8mb4_0900_bin behave more like other binary collations:
    
    1) Mark utf8mb4_0900_bin with the MY_CS_BINSORT flag so that it is
    regarded a binary collation, and is preferred when it's mixed with
    non-binary utf8mb4 collations.
    
    2) Reject aggregation of two different binary collations for the same
    character set. utf8mb4 is the only character set with more than one
    binary collation, so it only affects a mix of utf8mb4_bin and
    utf8mb4_0900_bin. When these two collations are mixed, and none of
    them has explicit derivation, one cannot determine if the padding
    behaviour of utf8mb4_bin should be used, or the non-padding behaviour
    of utf8mb4_0900_bin. Mixing them is allowed if a third collation with
    explicit derivation is included in the mix.
    
    Change-Id: I73960e71fcb768668c9112603c26f613acc9a92d
    f37b1fd1
    Bug#30350111: UTF8MB4_0900_BIN STRINGS CANNOT BE COMPARED WITH
    Knut Anders Hatlen authored
                  UTF8MB4_0900_AI_CI STRINGS
    
    The utf8mb4_0900_bin collation does not behave like other binary
    collations when it's mixed with non-binary collations. According to
    the documentation: "For an operation with operands from the same
    character set but that mix a _bin collation and a _ci or _cs
    collation, the _bin collation is used." But when mixing
    utf8mb4_0900_bin and for example utf8mb4_0900_ai_ci, the _bin
    collation is not preferred, and an error about illegal mix of
    collations is raised.
    
    This patch makes some changes to the collation aggregation to make
    utf8mb4_0900_bin behave more like other binary collations:
    
    1) Mark utf8mb4_0900_bin with the MY_CS_BINSORT flag so that it is
    regarded a binary collation, and is preferred when it's mixed with
    non-binary utf8mb4 collations.
    
    2) Reject aggregation of two different binary collations for the same
    character set. utf8mb4 is the only character set with more than one
    binary collation, so it only affects a mix of utf8mb4_bin and
    utf8mb4_0900_bin. When these two collations are mixed, and none of
    them has explicit derivation, one cannot determine if the padding
    behaviour of utf8mb4_bin should be used, or the non-padding behaviour
    of utf8mb4_0900_bin. Mixing them is allowed if a third collation with
    explicit derivation is included in the mix.
    
    Change-Id: I73960e71fcb768668c9112603c26f613acc9a92d
Loading