Skip to content

Commit

Permalink
Fix issue #10: Segfault in RDBSE_KEYDEF::get_primary_key_tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrunia authored and inikep committed May 27, 2023
1 parent 0d6edd8 commit 13d546d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions storage/rocksdb/rdb_datadic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ void RDBSE_KEYDEF::setup(TABLE *tbl)
if (keyno != tbl->s->primary_key)
{
n_pk_key_parts= pk_info->actual_key_parts;
pk_part_no= (uint*)my_malloc(sizeof(uint)*n_pk_key_parts, MYF(0));
}
else
{
pk_info= NULL;
pk_part_no= NULL;
n_pk_key_parts= 0;
}

// "unique" secondary keys support:
Expand All @@ -93,6 +92,11 @@ void RDBSE_KEYDEF::setup(TABLE *tbl)
unique_secondary_index= true;
}

if (keyno != tbl->s->primary_key)
pk_part_no= (uint*)my_malloc(sizeof(uint)*m_key_parts, MYF(0));
else
pk_part_no= NULL;

size_t size= sizeof(Field_pack_info) * m_key_parts;
pack_info= (Field_pack_info*)my_malloc(size, MYF(0));

Expand Down

0 comments on commit 13d546d

Please sign in to comment.