• Alexander Barkov's avatar
    MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations · 8020b1bd
    Alexander Barkov authored
    - Adding a new argument "flag" to MY_COLLATION_HANDLER::strnncollsp_nchars()
      and a flag MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES.
      The flag defines if strnncollsp_nchars() should emulate trailing spaces
      which were possibly trimmed earlier (e.g. in InnoDB CHAR compression).
      This is important for NOPAD collations.
    
      For example, with this input:
       - str1= 'a '    (Latin letter a followed by one space)
       - str2= 'a  '   (Latin letter a followed by two spaces)
       - nchars= 3
      if the flag is given, strnncollsp_nchars() will virtually restore
      one trailing space to str1 up to nchars (3) characters and compare two
      strings as equal:
      - str1= 'a  '  (one extra trailing space emulated)
      - str2= 'a  '  (as is)
    
      If the flag is not given, strnncollsp_nchars() does not add trailing
      virtual spaces, so in case of a NOPAD collation, str1 will be compared
      as less than str2 because it is shorter.
    
    - Field_string::...
    8020b1bd
ctype-tis620.c 46.8 KB