From 0b1edd43024aafbf79befe78a7c3ff703d1be150 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Tue, 8 Apr 2014 15:24:06 -0400 Subject: [PATCH] #206 support mariadb 10.0.10 alter compression table attribute --- storage/tokudb/ha_tokudb_alter_56.cc | 9 ++++++++- storage/tokudb/hatoku_defines.h | 1 + storage/tokudb/hatoku_hton.cc | 4 +--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index 48f9175ccd3..ba0a38a0194 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -414,6 +414,12 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt } else if (only_flags(ctx->handler_flags, Alter_inplace_info::CHANGE_CREATE_OPTION)) { HA_CREATE_INFO *create_info = ha_alter_info->create_info; +#if TOKU_INCLUDE_OPTION_STRUCTS + // set the USED_ROW_FORMAT flag for use later in this file for changes in the table's + // compression + if (create_info->option_struct->row_format != table_share->option_struct->row_format) + create_info->used_fields |= HA_CREATE_USED_ROW_FORMAT; +#endif // alter auto_increment if (only_flags(create_info->used_fields, HA_CREATE_USED_AUTO)) { // do a sanity check that the table is what we think it is @@ -723,7 +729,8 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i ha_alter_info->group_commit_ctx = NULL; } #endif -#if (50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599) +#if (50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599) || \ + (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099) if (TOKU_PARTITION_WRITE_FRM_DATA || altered_table->part_info == NULL) { int error = write_frm_data(share->status_block, ctx->alter_txn, altered_table->s->path.str); if (error) { diff --git a/storage/tokudb/hatoku_defines.h b/storage/tokudb/hatoku_defines.h index dbc043eb64c..244c3e2f316 100644 --- a/storage/tokudb/hatoku_defines.h +++ b/storage/tokudb/hatoku_defines.h @@ -103,6 +103,7 @@ PATENT RIGHTS GRANT: #define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 0 #define TOKU_INCLUDE_XA 1 #define TOKU_INCLUDE_WRITE_FRM_DATA 0 +#define TOKU_PARTITION_WRITE_FRM_DATA 0 #if defined(MARIADB_BASE_VERSION) #define TOKU_INCLUDE_EXTENDED_KEYS 1 #endif diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index e5a55720e57..e4b79a5c1f6 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -128,9 +128,7 @@ typedef struct savepoint_info { #if TOKU_INCLUDE_OPTION_STRUCTS ha_create_table_option tokudb_table_options[] = { - HA_TOPTION_ENUM("compression", row_format, - "TOKUDB_UNCOMPRESSED,TOKUDB_ZLIB,TOKUDB_QUICKLZ," - "TOKUDB_LZMA,TOKUDB_FAST,TOKUDB_SMALL", 0), + HA_TOPTION_SYSVAR("compression", row_format, row_format), HA_TOPTION_END };