• Marko Mäkelä's avatar
    MDEV-25440: Indexed CHAR columns are broken with NO_PAD collations · e9aac091
    Marko Mäkelä authored
    cmp_data(): Compare different-length CHAR fields with
    the new strnncollsp_nchars function that will pad spaces if needed.
    
    Any InnoDB ROW_FORMAT except the original one that was named
    ROW_FORMAT=REDUNDANT in MySQL 5.0.3 will internally store
    CHAR(n) columns as variable-length if the character encoding is
    variable length. Spaces may be trimmed from the end.
    For NOT NULL values, the minimum length is always n*mbminlen.
    In cmp_data() we only know the lengths in bytes and we cannot
    easily know the ROW_FORMAT.
    
    is_strnncoll_compatible(): Refactored from innobase_mysql_cmp().
    
    innobase_mysql_cmp(): Merged to cmp_whole_field().
    
    cmp_whole_field(): Invoke strnncollsp_nchars for the DATA_MYSQL
    (the CHAR type with any other collation than latin1_swedish_ci).
    
    Reviewed by: Alexander Barkov
    Tested by: Roel Roel Van de Paar
    e9aac091
no_pad.test 297 Bytes