• unknown's avatar
    Bug#29461: Sort order of the collation wasn't used when comparing characters · b0497925
    unknown authored
    with the space character.
    
    When the my_strnncollsp_simple function compares two strings and one is a prefix
    of another then this function compares characters in the rest of longer key
    with the space character to find whether the longer key is greater or less.
    But the sort order of the collation isn't used in this comparison. This may
    lead to a wrong comparison result, wrongly created index or wrong order of the
    result set of a query with the ORDER BY clause.
    
    Now the my_strnncollsp_simple function uses collation sort order to compare
    the characters in the rest of longer key with the space character.
    
    
    mysql-test/t/ctype_collate.test:
      Added a test case for the bug#29461: Sort order of the collation wasn't used when
      comparing characters with the space character.
    mysql-test/r/ctype_collate.result:
      Added a test case for the bug#29461: Sort order of the collation wasn't used when
      comparing characters with the space character.
    strings/ctype-simple.c:
      Bug#29461: Sort order of the collation wasn't used when comparing characters
      with the space character.Now the my_strnncollsp_simple function uses collation sort order to compare
      the characters in the rest of longer key with the space character.
    b0497925
ctype-simple.c 37.8 KB