1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-13795/MDEV-14332 Corruption during online table-rebuilding ALTER when VIRTUAL columns exist

When MySQL 5.7 introduced indexed virtual columns, it introduced
several bugs into the online table-rebuilding ALTER, that is,
the row_log_table_apply() family of functions.

The online_log format that was introduced for online table-rebuilding
ALTER in MySQL 5.6 should be sufficient. Ideally, any indexed virtual
column values would be evaluated based on the log records in the temporary
file. There is no need to log virtual column values.

(For ADD INDEX, that is row_log_apply(), we always must log the values of
the keys, no matter if the columns are virtual.)

Because omitting the virtual column values removes any chance of
row_log_table_apply() working with indexed virtual columns, we
will for now refuse LOCK=NONE in table-rebuilding ALTER operations
when indexes on virtual columns exist. This restriction would be
lifted in MDEV-14341.

innobase_indexed_virtual_exist(): New predicate, to determine if
indexed virtual columns exist in a table definition.

ha_innobase::check_if_supported_inplace_alter(): Refuse online rebuild
if indexed virtual columns exist.

rec_get_converted_size_temp_v(), rec_convert_dtuple_to_temp_v(): Remove.

row_log_table_delete(), row_log_table_update(, row_log_table_insert():
Remove parameters for virtual columns.

trx_undo_read_v_rows(): Remove the col_map parameter.

row_log_table_apply(): Do not deal with virtual columns.
This commit is contained in:
Marko Mäkelä
2017-11-09 23:01:44 +02:00
parent e2376e8137
commit 5d142f9958
18 changed files with 243 additions and 531 deletions

View File

@ -53,8 +53,11 @@ SELECT c FROM t;
SHOW CREATE TABLE t;
SELECT * FROM t;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t FORCE, LOCK=NONE;
if (0) {# MDEV-14341 TODO: re-enable this
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead';
--send ALTER TABLE t ADD COLUMN x INT
--send ALTER TABLE t FORCE
connection con1;
@ -78,7 +81,7 @@ check table t;
SELECT c FROM t;
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead';
--send ALTER TABLE t ADD COLUMN x2 INT
--send ALTER TABLE t FORCE
connection con1;
@ -93,6 +96,7 @@ connection default;
reap;
SELECT c FROM t;
}
disconnect con1;
DROP TABLE t;
@ -129,7 +133,7 @@ SELECT c FROM t;
DROP TABLE t;
if (0) {# MDEV-14341 TODO: re-enable LOCK=NONE and these tests
--echo #
--echo # Bug#22018532 ASSERTION WHEN ONLINE REAPPLY REBUILD LOG ON
--echo # MULTIPLE INDEXED VIRTUAL COLUMNS
@ -264,7 +268,7 @@ SELECT * FROM t;
DROP TABLE t;
disconnect con1;
}
SET DEBUG_SYNC = 'RESET';
--source include/wait_until_count_sessions.inc