Commit 14e9e75f authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs#5333 there can be only one column expansion at a time

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@47687 c7de825b-a66e-492c-adef-691d508d4ae1
parent cdb237e5
......@@ -737,14 +737,13 @@ static bool
change_length_is_supported(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx) {
if (table->s->fields != altered_table->s->fields)
return false;
if (ctx->changed_fields.elements() > 1)
return false; // only support one field change
for (int ai = 0; ai < ctx->changed_fields.elements(); ai++) {
uint i = ctx->changed_fields.at(ai);
Field *old_field = table->field[i];
Field *new_field = altered_table->field[i];
if (field_in_key(table, old_field))
return false;
if (field_in_key(altered_table, new_field))
if (field_in_key(table, old_field) || field_in_key(altered_table, new_field))
return false;
// varchar(X) -> varchar(Y)
if (!change_varchar_length_is_supported(old_field, new_field, table, altered_table, ha_alter_info, ctx))
......@@ -947,13 +946,13 @@ static bool
change_type_is_supported(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx) {
if (table->s->fields != altered_table->s->fields)
return false;
if (ctx->changed_fields.elements() > 1)
return false; // only support one field change
for (int ai = 0; ai < ctx->changed_fields.elements(); ai++) {
uint i = ctx->changed_fields.at(ai);
Field *old_field = table->field[i];
Field *new_field = altered_table->field[i];
if (field_in_key(table, old_field))
return false;
if (field_in_key(altered_table, new_field))
if (field_in_key(table, old_field) || field_in_key(altered_table, new_field))
return false;
if (!change_type_is_supported(old_field, new_field, table, altered_table, ha_alter_info, ctx))
return false;
......
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