Commit e1f5c58a authored by Nikita Malyavin's avatar Nikita Malyavin Committed by Sergei Golubchik

MDEV-30891 Assertion `!table->versioned(VERS_TRX_ID)' failed

Assertion `!table->versioned(VERS_TRX_ID)' failed in
Write_rows_log_event::binlog_row_logging_function during ONLINE ALTER.

trxid-versioned tables can't be replicated.
ONLINE ALTER will also be forbidden for these tables.
parent 5361b870
......@@ -120,3 +120,19 @@ ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock.
alter table t2 add c int, algorithm=copy;
alter table t2 add d int, algorithm=inplace;
drop table t2, t1;
#
# MDEV-30891 Assertion `!table->versioned(VERS_TRX_ID)' failed
# in Write_rows_log_event::binlog_row_logging_function
#
set system_versioning_alter_history= keep;
create table t1 (id int,
row_start bigint unsigned generated always as row start,
row_end bigint unsigned generated always as row end,
period for system_time (row_start, row_end))
engine=innodb with system versioning;
alter table t1 add c int, algorithm=copy, lock=none;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
alter table t1 add c int, algorithm=inplace;
alter table t1 add d int, lock=none;
set system_versioning_alter_history= default;
drop table t1;
......@@ -115,3 +115,23 @@ alter table t2 add c int, algorithm=copy;
alter table t2 add d int, algorithm=inplace;
# Cleanup
drop table t2, t1;
--echo #
--echo # MDEV-30891 Assertion `!table->versioned(VERS_TRX_ID)' failed
--echo # in Write_rows_log_event::binlog_row_logging_function
--echo #
set system_versioning_alter_history= keep;
create table t1 (id int,
row_start bigint unsigned generated always as row start,
row_end bigint unsigned generated always as row end,
period for system_time (row_start, row_end))
engine=innodb with system versioning;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t1 add c int, algorithm=copy, lock=none;
alter table t1 add c int, algorithm=inplace;
alter table t1 add d int, lock=none;
set system_versioning_alter_history= default;
drop table t1;
......@@ -10069,7 +10069,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
table= table_list->table;
bool is_reg_table= table->s->tmp_table == NO_TMP_TABLE;
online= online && !table->s->tmp_table;
online= online && !table->s->tmp_table && !table->versioned(VERS_TRX_ID);
List<FOREIGN_KEY_INFO> fk_list;
table->file->get_foreign_key_list(thd, &fk_list);
......
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