Skip to content

Commit

Permalink
In MariaDB, KEY::actual_key_parts is named ext_key_parts
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrunia committed Oct 9, 2016
1 parent 84dd647 commit d3cd64f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions storage/rocksdb/ha_rocksdb.cc
Expand Up @@ -5047,7 +5047,7 @@ int ha_rocksdb::create_cfs(const TABLE *table_arg, Rdb_tbl_def *tbl_def_arg,
!is_hidden_pk(i, table_arg, tbl_def_arg) &&
tbl_def_arg->base_tablename().find(tmp_file_prefix) != 0)
{
for (uint part= 0; part < table_arg->key_info[i].actual_key_parts; part++)
for (uint part= 0; part < table_arg->key_info[i].ext_key_parts; part++)
{
if (!rdb_is_index_collation_supported(
table_arg->key_info[i].key_part[part].field) &&
Expand Down Expand Up @@ -7124,7 +7124,7 @@ bool ha_rocksdb::can_use_single_delete(uint index)
{
return (index != pk_index(table, m_tbl_def) ||
(!has_hidden_pk(table) &&
table->key_info[index].actual_key_parts == table->s->fields));
table->key_info[index].ext_key_parts == table->s->fields));
}

bool ha_rocksdb::skip_unique_check()
Expand Down Expand Up @@ -8351,7 +8351,7 @@ int ha_rocksdb::info(uint flag)
continue;
}
KEY* k= &table->key_info[i];
for (uint j = 0; j < k->actual_key_parts; j++)
for (uint j = 0; j < k->ext_key_parts; j++)
{
const Rdb_index_stats& k_stats= m_key_descr_arr[i]->m_stats;
uint x = k_stats.m_distinct_keys_per_prefix.size() > j &&
Expand All @@ -8367,7 +8367,7 @@ int ha_rocksdb::info(uint flag)
// will have rec_per_key for (idx1)=4, (idx1,2)=2, and (idx1,2,3)=1.
// rec_per_key for the whole index is 1, and multiplied by 2^n if
// n suffix columns of the index are not used.
x = 1 << (k->actual_key_parts-j-1);
x = 1 << (k->ext_key_parts-j-1);
}
k->rec_per_key[j]= x;
}
Expand Down
8 changes: 4 additions & 4 deletions storage/rocksdb/rdb_datadic.cc
Expand Up @@ -160,15 +160,15 @@ void Rdb_key_def::setup(const TABLE *tbl, const Rdb_tbl_def *tbl_def)
}

if (secondary_key)
m_pk_key_parts= hidden_pk_exists ? 1 : pk_info->actual_key_parts;
m_pk_key_parts= hidden_pk_exists ? 1 : pk_info->ext_key_parts;
else
{
pk_info= nullptr;
m_pk_key_parts= 0;
}

// "unique" secondary keys support:
m_key_parts= is_hidden_pk ? 1 : key_info->actual_key_parts;
m_key_parts= is_hidden_pk ? 1 : key_info->ext_key_parts;

if (secondary_key)
{
Expand Down Expand Up @@ -229,7 +229,7 @@ void Rdb_key_def::setup(const TABLE *tbl, const Rdb_tbl_def *tbl_def)
{
/* Check if this field is already present in the key definition */
bool found= false;
for (uint j= 0; j < key_info->actual_key_parts; j++)
for (uint j= 0; j < key_info->ext_key_parts; j++)
{
if (field->field_index == key_info->key_part[j].field->field_index)
{
Expand Down Expand Up @@ -285,7 +285,7 @@ void Rdb_key_def::setup(const TABLE *tbl, const Rdb_tbl_def *tbl_def)
For "unique" secondary indexes, pretend they have
"index extensions"
*/
if (secondary_key && src_i+1 == key_info->actual_key_parts)
if (secondary_key && src_i+1 == key_info->ext_key_parts)
{
simulating_extkey= true;
if (!hidden_pk_exists)
Expand Down

0 comments on commit d3cd64f

Please sign in to comment.