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

get_partition_set is never executed in ha_partition::multi_range_key_create_key due to bitwise & with 0 constant

    XMLWordPrintable

Details

    Description

      /sql/ha_partition.cc : 6261

      HA_READ_KEY_EXACT is defined as 0, so bitwise & gives 0 regardless of start_key->flag value and the whole if condition is always false. As a result get_partition_set is never executed, which might affect performance.

      if (start_key->key && (start_key->flag & HA_READ_KEY_EXACT))
      get_partition_set(table, table->record[0], active_index,
      start_key, &m_part_spec);
      else

      { m_part_spec.start_part= 0; m_part_spec.end_part= m_tot_parts - 1; }

      To fix that we need to compare using == instead of &:
      if (start_key->key && (start_key->flag == HA_READ_KEY_EXACT))

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              yury.chaikou Yury Chaikou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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