|
/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))
|