• mithun's avatar
    Bug #14057034 : WASTED CPU CYCLES IN MY_UTF8_UNI WHERE · 7c9112b9
    mithun authored
                    RESULTING MY_WC_T RESULT IS NOT USED
    Issue         : handler functions my_ismbchar_utf8,
                  my_well_formed_len_mb for charset utf8
                  is calling unicode converion function
                  to validate and to find the character
                  length. Because of this, instructions
                  which will convert the utf8 to unicode
                  are executed for no use.
                  A similar issue exist with charset utf8mb4
    Solution      : reorganized the code such that character
                  validation part of unicode conversion
                  handler is extracted(duplicated) in to
                  separate function. Hence
                  my_ismbchar_utf8, my_well_formed_len_mb
                  will call the new function which only
                  validates and return the length of mb(utf8).
                  A similar fix for charset utf8mb4.
    
    strings/ctype-utf8.c:
      New functions has been added for charset utf8 and utf8mb4
      to validate and to get the length of the character.
    7c9112b9
ctype-utf8.c 223 KB