mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
Changing columns WITH/WITHOUT SYSTEM VERSIONING doens't require to read data at all. Thus it should be an instant operation. Patch also fixes a bug when ALTER_COLUMN_UNVERSIONED wasn't passed to InnoDB to change its internal structures. change_field_versioning_try(): apply WITH/WITHOUT SYSTEM VERSIONING change in SYS_COLUMNS for one field. change_fields_versioning_try(): apply WITH/WITHOUT SYSTEM VERSIONING change in SYS_COLUMNS for every changed field in a table. change_fields_versioning_cache(): update cache for versioning property of columns.
This commit is contained in:
committed by
Marko Mäkelä
parent
ff09512e07
commit
9dc81f7d38
@ -6535,15 +6535,15 @@ static bool fill_alter_inplace_info(THD *thd,
|
||||
ALTER_DROP_INDEX are replaced with versions that have higher granuality.
|
||||
*/
|
||||
|
||||
ha_alter_info->handler_flags|= (alter_info->flags &
|
||||
~(ALTER_ADD_INDEX |
|
||||
ALTER_DROP_INDEX |
|
||||
ALTER_PARSER_ADD_COLUMN |
|
||||
ALTER_PARSER_DROP_COLUMN |
|
||||
ALTER_COLUMN_ORDER |
|
||||
ALTER_RENAME_COLUMN |
|
||||
ALTER_CHANGE_COLUMN |
|
||||
ALTER_COLUMN_UNVERSIONED));
|
||||
alter_table_operations flags_to_remove=
|
||||
ALTER_ADD_INDEX | ALTER_DROP_INDEX | ALTER_PARSER_ADD_COLUMN |
|
||||
ALTER_PARSER_DROP_COLUMN | ALTER_COLUMN_ORDER | ALTER_RENAME_COLUMN |
|
||||
ALTER_CHANGE_COLUMN;
|
||||
|
||||
if (!table->file->native_versioned())
|
||||
flags_to_remove|= ALTER_COLUMN_UNVERSIONED;
|
||||
|
||||
ha_alter_info->handler_flags|= (alter_info->flags & ~flags_to_remove);
|
||||
/*
|
||||
Comparing new and old default values of column is cumbersome.
|
||||
So instead of using such a comparison for detecting if default
|
||||
|
Reference in New Issue
Block a user