Commit 5e66f5c5 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #1326

no longer read off end

git-svn-id: file:///svn/mysql/tokudb-engine/src@8320 c7de825b-a66e-492c-adef-691d508d4ae1
parent 388b5b2e
...@@ -1284,7 +1284,10 @@ int ha_tokudb::pack_row(DBT * row, const uchar * record, bool strip_pk) { ...@@ -1284,7 +1284,10 @@ int ha_tokudb::pack_row(DBT * row, const uchar * record, bool strip_pk) {
// if the primary key is hidden, primary_key_offsets will be NULL and // if the primary key is hidden, primary_key_offsets will be NULL and
// this clause will not execute // this clause will not execute
// //
if (primary_key_offsets && strip_pk) { if (primary_key_offsets &&
strip_pk &&
curr_skip_index < table_share->key_info[table_share->primary_key].key_parts
) {
uint curr_skip_offset = primary_key_offsets[curr_skip_index].offset; uint curr_skip_offset = primary_key_offsets[curr_skip_index].offset;
if (curr_skip_offset == curr_field_offset) { if (curr_skip_offset == curr_field_offset) {
// //
...@@ -1382,7 +1385,10 @@ void ha_tokudb::unpack_row(uchar * record, DBT const *row, DBT const *key, bool ...@@ -1382,7 +1385,10 @@ void ha_tokudb::unpack_row(uchar * record, DBT const *row, DBT const *key, bool
uint curr_skip_index = 0; uint curr_skip_index = 0;
for (Field ** field = table->field; *field; field++) { for (Field ** field = table->field; *field; field++) {
uint curr_field_offset = field_offset(*field, table); uint curr_field_offset = field_offset(*field, table);
if (primary_key_offsets && pk_stripped) { if (primary_key_offsets &&
pk_stripped &&
curr_skip_index < table_share->key_info[table_share->primary_key].key_parts
) {
uint curr_skip_offset = primary_key_offsets[curr_skip_index].offset; uint curr_skip_offset = primary_key_offsets[curr_skip_index].offset;
if (curr_skip_offset == curr_field_offset) { if (curr_skip_offset == curr_field_offset) {
// //
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment