Commit e1d0a2e5 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs #5333 dont allow hot char <-> char binary conversions

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@47645 c7de825b-a66e-492c-adef-691d508d4ae1
parent 561a218e
...@@ -282,7 +282,8 @@ ha_tokudb::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_ ...@@ -282,7 +282,8 @@ ha_tokudb::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_
} }
} else } else
// change column type // change column type
if (only_flags(ctx->handler_flags, Alter_inplace_info::ALTER_COLUMN_TYPE + Alter_inplace_info::ALTER_COLUMN_DEFAULT)) { if ((ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_TYPE) &&
only_flags(ctx->handler_flags, Alter_inplace_info::ALTER_COLUMN_TYPE + Alter_inplace_info::ALTER_COLUMN_DEFAULT + Alter_inplace_info::ALTER_COLUMN_NAME)) {
find_changed_fields(table, altered_table, ha_alter_info, ctx->changed_fields); find_changed_fields(table, altered_table, ha_alter_info, ctx->changed_fields);
ctx->table_kc_info = &share->kc_info; ctx->table_kc_info = &share->kc_info;
ctx->altered_table_kc_info = &ctx->altered_table_kc_info_base; ctx->altered_table_kc_info = &ctx->altered_table_kc_info_base;
...@@ -923,7 +924,7 @@ change_type_is_supported(Field *old_field, Field *new_field, TABLE *table, TABLE ...@@ -923,7 +924,7 @@ change_type_is_supported(Field *old_field, Field *new_field, TABLE *table, TABLE
return false; return false;
} else if (old_type == MYSQL_TYPE_STRING) { } else if (old_type == MYSQL_TYPE_STRING) {
// char(X) -> char(Y) and binary(X) -> binary(Y) expansion // char(X) -> char(Y) and binary(X) -> binary(Y) expansion
if (new_type == MYSQL_TYPE_STRING && old_field->binary() == new_field->binary()) if (new_type == MYSQL_TYPE_STRING && old_field->binary() == new_field->binary() && old_field->charset() == new_field->charset())
return change_fixed_length_is_supported(table, altered_table, old_field, new_field, ctx); return change_fixed_length_is_supported(table, altered_table, old_field, new_field, ctx);
else else
return false; return false;
......
...@@ -6,8 +6,6 @@ enum { ...@@ -6,8 +6,6 @@ enum {
UPDATE_OP_EXPAND_UINT = 3, UPDATE_OP_EXPAND_UINT = 3,
UPDATE_OP_EXPAND_CHAR = 4, UPDATE_OP_EXPAND_CHAR = 4,
UPDATE_OP_EXPAND_BINARY = 5, UPDATE_OP_EXPAND_BINARY = 5,
UPDATE_OP_ADD_INT = 6,
UPDATE_OP_SUB_INT = 7,
}; };
#define UP_COL_ADD_OR_DROP UPDATE_OP_COL_ADD_OR_DROP #define UP_COL_ADD_OR_DROP UPDATE_OP_COL_ADD_OR_DROP
...@@ -63,17 +61,16 @@ enum { ...@@ -63,17 +61,16 @@ enum {
// offset_start 4 starting offset of the variable length field offsets // offset_start 4 starting offset of the variable length field offsets
// offset end 4 ending offset of the variable length field offsets // offset end 4 ending offset of the variable length field offsets
// operation 1 == UPDATE_OP_EXPAND_INT, UPDATE_OP_EXPAND_UINT, UPDATE_OP_EXPAND_CHAR, UPDATE_OP_EXPAND_BINARY // operation 1 == UPDATE_OP_EXPAND_INT/UINT, UPDATE_OP_EXPAND_CHAR, UPDATE_OP_EXPAND_BINARY
// old offset 4 // old offset 4
// old length 4 // old length 4
// new offset 4 // new offset 4
// new length 4 // new length 4
// operation 1 == UPDATE_OP_INT_ADD or UPDATE_OP_INT_SUB // operation 1 == UPDATE_OP_INT/UINT_ADD/SUB
// offset 4 starting offset of the int type field // offset 4 starting offset of the int type field
// length 4 length of the int type field // length 4 length of the int type field
// value 4 value to add or subtract (common use case is increment or decrement by 1) // value 4 value to add or subtract (common use case is increment or decrement by 1)
// is unsigned 1
// //
// checks whether the bit at index pos in data is set or not // checks whether the bit at index pos in data is set or not
......
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