Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-39188

Dead code XXH3_len_17to128_64b()

    XMLWordPrintable

Details

    Description

      The maximum length that we seem to pass to the hashing functions appears to be only 16 bytes. Therefore, at least the following code is unreachable in our test suite:

      diff --git a/mysys/xxhash.h b/mysys/xxhash.h
      index 78fc2e8dbf6..5ecd223818a 100644
      --- a/mysys/xxhash.h
      +++ b/mysys/xxhash.h
      @@ -4769,6 +4769,7 @@ XXH3_len_17to128_64b(const xxh_u8* XXH_RESTRICT input, size_t len,
       {
           XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;
           XXH_ASSERT(16 < len && len <= 128);
      +    abort();
       
           {   xxh_u64 acc = len * XXH_PRIME64_1;
       #if XXH_SIZE_OPT >= 1
      

      patched 12.3 868ab472e6b097967b7e6338b1b0a07ee92ca249

      main.partition_key_algorithm 'xxh3'      w2 [ pass ]     56
      main.partition_key_algorithm 'mysql51'   w5 [ pass ]     78
      main.partition_key_algorithm 'xxh32'     w1 [ pass ]     84
      main.partition_key_algorithm 'none'      w4 [ pass ]    102
      main.partition_key_algorithm '2'         w3 [ pass ]     72
      main.partition_key_algorithm 'crc32c'    w9 [ pass ]     78
      main.partition_key_algorithm 'base31'    w7 [ pass ]    102
      main.partition_key_algorithm '1'         w6 [ pass ]    110
      main.partition_key_algorithm 'mysql55'   w8 [ pass ]    107
      

      Either the code is truly dead and should be removed to reduce code bloat and improve performance, or the test coverage needs to be improved.

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.