-
Roy Lyseng authored
When changing a generated column's expression, a check for whether the expression was the same as before was missing. If the expression is changed, storage engine may need to rebuild the column. (A virtual column generally does not need rebuilding, but if is indexed, the index will need rebuilding). Two new utility functions to check that generation expressions are equal are implemented: Field::gcol_expr_is_equal(). In fill_alter_inplace_info(), generate change commands for the storage engine according to the following: - It is possible a convert a base column to a generated column and vice versa as long as the generated column is stored. Set the handler flag ALTER_STORED_COLUMN_TYPE for this case. - If both source and target column is generated and generation expression is modified, set handler flag ALTER_STORED_COLUMN_TYPE if column is stored and ALTER_VIRTUAL_COLUMN_TYPE if column is virtual. Elaborate testing has been added: - Check modification to and from generated column. - Check modification of generated column with and without non-unique index and unique index.
Roy Lyseng authoredWhen changing a generated column's expression, a check for whether the expression was the same as before was missing. If the expression is changed, storage engine may need to rebuild the column. (A virtual column generally does not need rebuilding, but if is indexed, the index will need rebuilding). Two new utility functions to check that generation expressions are equal are implemented: Field::gcol_expr_is_equal(). In fill_alter_inplace_info(), generate change commands for the storage engine according to the following: - It is possible a convert a base column to a generated column and vice versa as long as the generated column is stored. Set the handler flag ALTER_STORED_COLUMN_TYPE for this case. - If both source and target column is generated and generation expression is modified, set handler flag ALTER_STORED_COLUMN_TYPE if column is stored and ALTER_VIRTUAL_COLUMN_TYPE if column is virtual. Elaborate testing has been added: - Check modification to and from generated column. - Check modification of generated column with and without non-unique index and unique index.
Loading