From d003df895b6ee1871f1efa6e2ba2cb504876e2cf Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Tue, 3 Jul 2012 17:25:17 +0000 Subject: [PATCH] #4505 use hot alter table in mysql 5.5 refs #4505 git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@45255 c7de825b-a66e-492c-adef-691d508d4ae1 --- storage/tokudb/ha_tokudb.h | 2 +- storage/tokudb/ha_tokudb_alter_56.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index 0cd0dd05c09..8718cc298fe 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -20,7 +20,7 @@ #endif #if 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599 -#define TOKU_INCLUDE_ALTER_56 0 +#define TOKU_INCLUDE_ALTER_56 1 #define TOKU_INCLUDE_ALTER_55 1 #define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 1 #define TOKU_INCLUDE_XA 1 diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index e552ff1f6b3..c64524f6cdb 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -862,10 +862,10 @@ ha_tokudb::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alte int ha_tokudb::alter_table_add_index(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { - // TODO what does this do? + // sort keys in add index order KEY *key_info = (KEY*) my_malloc(sizeof (KEY) * ha_alter_info->index_add_count, MYF(MY_WME)); - KEY *key = key_info; for (uint i = 0; i < ha_alter_info->index_add_count; i++) { + KEY *key = &key_info[i]; *key = ha_alter_info->key_info_buffer[ha_alter_info->index_add_buffer[i]]; for (KEY_PART_INFO *key_part= key->key_part; key_part < key->key_part + key->key_parts; key_part++) key_part->field = table->field[key_part->fieldnr];