Commit db677cc6 authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 5a61fa98
...@@ -72,6 +72,11 @@ static const alter_table_operations INNOBASE_ONLINE_CREATE ...@@ -72,6 +72,11 @@ static const alter_table_operations INNOBASE_ONLINE_CREATE
= ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX = ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX
| ALTER_ADD_UNIQUE_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 */ /** Operations for rebuilding a table in place */
static const alter_table_operations INNOBASE_ALTER_REBUILD static const alter_table_operations INNOBASE_ALTER_REBUILD
= ALTER_ADD_PK_INDEX = ALTER_ADD_PK_INDEX
...@@ -79,10 +84,9 @@ static const alter_table_operations INNOBASE_ALTER_REBUILD ...@@ -79,10 +84,9 @@ static const alter_table_operations INNOBASE_ALTER_REBUILD
| ALTER_CHANGE_CREATE_OPTION | ALTER_CHANGE_CREATE_OPTION
/* CHANGE_CREATE_OPTION needs to check create_option_need_rebuild() */ /* CHANGE_CREATE_OPTION needs to check create_option_need_rebuild() */
| ALTER_COLUMN_NULLABLE | ALTER_COLUMN_NULLABLE
| ALTER_COLUMN_NOT_NULLABLE | INNOBASE_DEFAULTS
| ALTER_STORED_COLUMN_ORDER | ALTER_STORED_COLUMN_ORDER
| ALTER_DROP_STORED_COLUMN | ALTER_DROP_STORED_COLUMN
| ALTER_ADD_STORED_BASE_COLUMN
| ALTER_RECREATE_TABLE | ALTER_RECREATE_TABLE
/* /*
| ALTER_STORED_COLUMN_TYPE | ALTER_STORED_COLUMN_TYPE
...@@ -130,10 +134,6 @@ static const alter_table_operations INNOBASE_ALTER_INSTANT ...@@ -130,10 +134,6 @@ static const alter_table_operations INNOBASE_ALTER_INSTANT
| ALTER_COLUMN_EQUAL_PACK_LENGTH | ALTER_COLUMN_EQUAL_PACK_LENGTH
| ALTER_DROP_VIRTUAL_COLUMN; | 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 struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
{ {
/** Dummy query graph */ /** Dummy query graph */
...@@ -3309,8 +3309,7 @@ innobase_build_col_map( ...@@ -3309,8 +3309,7 @@ innobase_build_col_map(
+ dict_table_get_n_v_cols(old_table) + dict_table_get_n_v_cols(old_table)
>= table->s->fields + DATA_N_SYS_COLS); >= table->s->fields + DATA_N_SYS_COLS);
DBUG_ASSERT(!!defaults == !!(ha_alter_info->handler_flags DBUG_ASSERT(!!defaults == !!(ha_alter_info->handler_flags
& (ALTER_ADD_COLUMN & INNOBASE_DEFAULTS));
| ALTER_COLUMN_NOT_NULLABLE)));
DBUG_ASSERT(!defaults || dtuple_get_n_fields(defaults) DBUG_ASSERT(!defaults || dtuple_get_n_fields(defaults)
== dict_table_get_n_cols(new_table)); == dict_table_get_n_cols(new_table));
......
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