• Alexander Barkov's avatar
    MDEV-30048 Prefix keys for CHAR work differently for MyISAM vs InnoDB · df72c57d
    Alexander Barkov authored
    Also fixes: MDEV-30050 Inconsistent results of DISTINCT with NOPAD
    
    Problem:
    
    Key segments for CHAR columns where compared using strnncollsp()
    for engines MyISAM and Aria.
    
    This did not work correct in case if the engine applyied trailing
    space compression.
    
    Fix:
    
    Replacing ha_compare_text() calls to new functions:
    
    - ha_compare_char_varying()
    - ha_compare_char_fixed()
    - ha_compare_word()
    - ha_compare_word_prefix()
    - ha_compare_word_or_prefix()
    
    The code branch corresponding to comparison of CHAR column keys
    (HA_KEYTYPE_TEXT segment type) now uses ha_compare_char_fixed()
    which calls strnncollsp_nchars().
    
    This patch does not change the behavior for the rest of the code:
    - comparison of VARCHAR/TEXT column keys
      (HA_KEYTYPE_VARTEXT1, HA_KEYTYPE_VARTEXT2 segments types)
    - comparison in the fulltext code
    df72c57d
mi_write.c 33.3 KB