Commit 18deed4a authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #846

table->s->max_key_length does not take into account new keys that are being added, and therefore is not suitable as a buffer size

git-svn-id: file:///svn/mysql/tokudb-engine/src@4167 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1147c3a9
...@@ -3238,6 +3238,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) { ...@@ -3238,6 +3238,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
DBT current_primary_key; DBT current_primary_key;
DBT row; DBT row;
DB_TXN* txn = NULL; DB_TXN* txn = NULL;
uchar tmp_key_buff[table_arg->s->rec_buff_length];
// //
// these variables are for error handling // these variables are for error handling
// //
...@@ -3309,7 +3310,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) { ...@@ -3309,7 +3310,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
unpack_row(tmp_record, &row); unpack_row(tmp_record, &row);
for (uint i = 0; i < num_of_keys; i++) { for (uint i = 0; i < num_of_keys; i++) {
DBT secondary_key; DBT secondary_key;
create_dbt_key_from_key(&secondary_key,&key_info[i], key_buff, tmp_record); create_dbt_key_from_key(&secondary_key,&key_info[i], tmp_key_buff, tmp_record);
uint curr_index = i + table_arg->s->keys; uint curr_index = i + table_arg->s->keys;
u_int32_t put_flags = share->key_type[curr_index]; u_int32_t put_flags = share->key_type[curr_index];
......
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