1. 19 Oct, 2021 9 commits
  2. 15 Oct, 2021 1 commit
  3. 14 Oct, 2021 7 commits
    • Vladislav Vaintroub's avatar
      MDEV-26806 Server crash in Charset::charset / Item_func_natural_sort_key::val_str · a6cf8b34
      Vladislav Vaintroub authored
      The reason for crash is that natural_sort_key(release_lock('a')) would
      evaluate release_lock() twice, once in Item::is_null() and another time
      in Item::val_str(). Second time it returns NULL, since lock was already
      released.
      
      Fixed to prevent double evaluation.
      a6cf8b34
    • Vladislav Vaintroub's avatar
      MDEV-26796 Natural sort does not work for utf32/utf16/ucs2 · bc09362e
      Vladislav Vaintroub authored
      Fixed typo, added test.
      bc09362e
    • Vladislav Vaintroub's avatar
      MDEV-26786 Inserting NULL into base column breaks NATURAL_SORT_KEY column · 5b5a67b2
      Vladislav Vaintroub authored
      When returning non-null value from natural_sort_key, make sure
      Item::null_value is false.
      5b5a67b2
    • Vladislav Vaintroub's avatar
      MDEV-4742 - remove leading zero handling, and cleanups. · 6c5c1fd5
      Vladislav Vaintroub authored
      Leading zeros added a single byte overhead per numeric string,
      even when they were. Sorting leading zeros offers only for little value
      (except determinism in sort). I decided to drop it for now, we can be
      like ICU, which drops leading zeros, in numeric sorting,
      even with IDENTICAL collation strength.
      
      
      Also, disabled virtual stored columns (thus also indexes), on Serg's request
      Hopefully it is temporarily, and will be reenabled soon, when everyone is
      as happy with key generation algorithm as I am.
      6c5c1fd5
    • Vladislav Vaintroub's avatar
      MDEV-4742 additions · 167d2509
      Vladislav Vaintroub authored
      - return error from natsort_encode_numeric_key, if it would need
      to allocate memory. All needed memory was preallocated much earlier.
      
      - Add test for sort order of leading zero vs numeric strings with suffix.
      167d2509
    • Vladislav Vaintroub's avatar
      MDEV-4742 - address review comments. · b3cedf63
      Vladislav Vaintroub authored
      - Remove second optional parameter to natural_sort_key(), and all fraction
      handling.
      
      - Rename natsort_num2str() to natsort_encode_length() to show the intention
      that it encodes string *lengths*, and not encode whitespaces and what not.
      
      Handles lengths for which log10(len) >= 10,  even if they do not happen for
      MariaDB Strings (where length is limited by 32bit, and log10(len) is <= 9)
      
      - Do not let natural sort key grow past max_packet_length.
      
      
      - Split Item_func_natural_sort_key::val_str() further and add
      natsort_encode_numeric_string(), which contains comment on how
      whitespaces are handled.
      
      - Simplify, and speedup to_natsort_key() in common case, by removing
      handling of weird charsets utf16/32, that encode numbers in several bytes.
      In rare cases utf16/32 is used, we'll convert to utf8 prior to
      creating keys, and back to original charset afterwards.
      b3cedf63
    • Vladislav Vaintroub's avatar
      MDEV-4742 - provide function to sort string in "natural" order · 5b29d407
      Vladislav Vaintroub authored
      The numbers should be compared as numbers,  while the rest should be compared
      as string.
      
      Introduce natural_sort_key() function that transforms original string
      so that the lexicographic order of such keys is suitable for
      natural sort.
      5b29d407
  4. 13 Oct, 2021 12 commits
  5. 12 Oct, 2021 11 commits