diff options
author | Rich Prohaska <prohaska@tokutek.com> | 2013-12-20 07:28:08 -0500 |
---|---|---|
committer | Rich Prohaska <prohaska@tokutek.com> | 2013-12-20 07:28:08 -0500 |
commit | 8bcf6c53792294dfd16688403349a855777ce0a1 (patch) | |
tree | 42a0ab30323ee61484d3fa5ff8421d8e51cb3c8e /storage | |
parent | 2b6da0f20f77d68149671074df830d35353abd04 (diff) | |
download | mariadb-git-8bcf6c53792294dfd16688403349a855777ce0a1.tar.gz |
add a session variable that controls whether or not alter table errors are printed to stderr
Diffstat (limited to 'storage')
-rw-r--r-- | storage/tokudb/ha_tokudb_alter_56.cc | 12 | ||||
-rw-r--r-- | storage/tokudb/hatoku_hton.h | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index 15b8899b8bc..aedf0183756 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -216,7 +216,7 @@ static bool change_length_is_supported(TABLE *table, TABLE *altered_table, Alter static bool change_type_is_supported(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx); // The ha_alter_info->handler_flags can not be trusted. This function maps the bogus handler flags to something we like. -static ulong fix_handler_flags(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +static ulong fix_handler_flags(THD *thd, TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info) { ulong handler_flags = ha_alter_info->handler_flags; // workaround for fill_alter_inplace_info bug (#5193) @@ -225,7 +225,7 @@ static ulong fix_handler_flags(TABLE *table, TABLE *altered_table, Alter_inplace // column addition later. if (handler_flags & (Alter_inplace_info::ADD_COLUMN + Alter_inplace_info::DROP_COLUMN)) { if (handler_flags & (Alter_inplace_info::ADD_INDEX + Alter_inplace_info::DROP_INDEX)) { - if (tables_have_same_keys(table, altered_table, false, false)) { + if (tables_have_same_keys(table, altered_table, THDVAR(thd, alter_print_error) != 0, false)) { handler_flags &= ~(Alter_inplace_info::ADD_INDEX + Alter_inplace_info::DROP_INDEX); } } @@ -294,7 +294,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt // setup context tokudb_alter_ctx *ctx = new tokudb_alter_ctx; ha_alter_info->handler_ctx = ctx; - ctx->handler_flags = fix_handler_flags(table, altered_table, ha_alter_info); + ctx->handler_flags = fix_handler_flags(thd, table, altered_table, ha_alter_info); ctx->table_kc_info = &share->kc_info; ctx->altered_table_kc_info = &ctx->altered_table_kc_info_base; memset(ctx->altered_table_kc_info, 0, sizeof (KEY_AND_COL_INFO)); @@ -306,7 +306,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt if (only_flags(ctx->handler_flags, Alter_inplace_info::DROP_INDEX + Alter_inplace_info::DROP_UNIQUE_INDEX + Alter_inplace_info::ADD_INDEX + Alter_inplace_info::ADD_UNIQUE_INDEX)) { if ((ha_alter_info->index_add_count > 0 || ha_alter_info->index_drop_count > 0) && - !tables_have_same_keys(table, altered_table, false, false) && + !tables_have_same_keys(table, altered_table, THDVAR(thd, alter_print_error) != 0, false) && is_disjoint_add_drop(ha_alter_info)) { if (ctx->handler_flags & (Alter_inplace_info::DROP_INDEX + Alter_inplace_info::DROP_UNIQUE_INDEX)) { @@ -413,14 +413,14 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt // 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 - if (tables_have_same_keys_and_columns(table, altered_table, true)) { + if (tables_have_same_keys_and_columns(table, altered_table, THDVAR(thd, alter_print_error) != 0)) { result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } } // alter row_format else if (only_flags(create_info->used_fields, HA_CREATE_USED_ROW_FORMAT)) { // do a sanity check that the table is what we think it is - if (tables_have_same_keys_and_columns(table, altered_table, true)) { + if (tables_have_same_keys_and_columns(table, altered_table, THDVAR(thd, alter_print_error) != 0)) { result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } } diff --git a/storage/tokudb/hatoku_hton.h b/storage/tokudb/hatoku_hton.h index 62538fe00a2..056a6bd5ff7 100644 --- a/storage/tokudb/hatoku_hton.h +++ b/storage/tokudb/hatoku_hton.h @@ -181,6 +181,14 @@ static bool get_create_index_online(THD* thd) { return (THDVAR(thd, create_index_online) != 0); } +static MYSQL_THDVAR_BOOL(alter_print_error, + 0, + "Print errors for alter table operations", + NULL, + NULL, + false +); + static MYSQL_THDVAR_BOOL(disable_prefetching, 0, "if on, prefetching disabled", |