Skip to content
Permalink
Browse files
Follow-up to MDEV-14168: Correct INNOBASE_DEFAULTS
INNOBASE_DEFAULTS: Replace ALTER_ADD_COLUMN with the more appropriate
ALTER_ADD_STORED_BASE_COLUMN. This clean-up causes no change of
behaviour, because ALGORITHM=INPLACE would be refused for
ALTER_ADD_STORED_GENERATED_COLUMN, and default values are not computed
nor substituted for ALTER_ADD_VIRTUAL_COLUMN.
  • Loading branch information
dr-m committed May 31, 2018
1 parent 5a61fa9 commit db677cc
Showing 1 changed file with 7 additions and 8 deletions.
@@ -72,17 +72,21 @@ static const alter_table_operations INNOBASE_ONLINE_CREATE
= ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX
| ALTER_ADD_UNIQUE_INDEX;

/** Operations that require filling in default values for columns */
static const alter_table_operations INNOBASE_DEFAULTS
= ALTER_COLUMN_NOT_NULLABLE
| ALTER_ADD_STORED_BASE_COLUMN;

/** Operations for rebuilding a table in place */
static const alter_table_operations INNOBASE_ALTER_REBUILD
= ALTER_ADD_PK_INDEX
| ALTER_DROP_PK_INDEX
| ALTER_CHANGE_CREATE_OPTION
/* CHANGE_CREATE_OPTION needs to check create_option_need_rebuild() */
| ALTER_COLUMN_NULLABLE
| ALTER_COLUMN_NOT_NULLABLE
| INNOBASE_DEFAULTS
| ALTER_STORED_COLUMN_ORDER
| ALTER_DROP_STORED_COLUMN
| ALTER_ADD_STORED_BASE_COLUMN
| ALTER_RECREATE_TABLE
/*
| ALTER_STORED_COLUMN_TYPE
@@ -130,10 +134,6 @@ static const alter_table_operations INNOBASE_ALTER_INSTANT
| ALTER_COLUMN_EQUAL_PACK_LENGTH
| ALTER_DROP_VIRTUAL_COLUMN;

static const alter_table_operations INNOBASE_DEFAULTS
= ALTER_COLUMN_NOT_NULLABLE
| ALTER_ADD_COLUMN;

struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
{
/** Dummy query graph */
@@ -3309,8 +3309,7 @@ innobase_build_col_map(
+ dict_table_get_n_v_cols(old_table)
>= table->s->fields + DATA_N_SYS_COLS);
DBUG_ASSERT(!!defaults == !!(ha_alter_info->handler_flags
& (ALTER_ADD_COLUMN
| ALTER_COLUMN_NOT_NULLABLE)));
& INNOBASE_DEFAULTS));
DBUG_ASSERT(!defaults || dtuple_get_n_fields(defaults)
== dict_table_get_n_cols(new_table));

0 comments on commit db677cc

Please sign in to comment.