mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
don't do ALTER IGNORE TABLE online
because online means we'll apply events from the binlog, and ignore means that bad rows will be skipped. So a bad Write_row_log_event will be skipped and a following Update_row_log_event will fail to apply.
This commit is contained in:
@ -1,4 +1,11 @@
|
||||
#
|
||||
# alter ignore cannot be done online
|
||||
#
|
||||
create table t (a int);
|
||||
alter ignore table t add primary key (a), algorithm=copy, lock=none;
|
||||
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
|
||||
drop table t;
|
||||
#
|
||||
# MDEV-28771 Assertion `table->in_use&&tdc->flushed' failed after ALTER
|
||||
#
|
||||
create table t (a char(1));
|
||||
|
@ -1,6 +1,14 @@
|
||||
--source include/binlog_combinations.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # alter ignore cannot be done online
|
||||
--echo #
|
||||
create table t (a int);
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
alter ignore table t add primary key (a), algorithm=copy, lock=none;
|
||||
drop table t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28771 Assertion `table->in_use&&tdc->flushed' failed after ALTER
|
||||
--echo #
|
||||
|
@ -654,8 +654,9 @@ create table t1 (a char(9), b char(9) as (a) stored);
|
||||
insert into t1(a) values ('foobar');
|
||||
set debug_sync= 'now wait_for downgraded';
|
||||
connection con2;
|
||||
set sql_mode='';
|
||||
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
|
||||
alter ignore table t1 drop b, add b char(3) as (a) stored, algorithm=copy, lock=none;
|
||||
alter table t1 drop b, add b char(3) as (a) stored, algorithm=copy, lock=none;
|
||||
connection default;
|
||||
update t1 set a = 'foobarqux';
|
||||
set debug_sync= 'now signal goforit';
|
||||
@ -663,6 +664,7 @@ connection con2;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'b' at row 1
|
||||
Warning 1265 Data truncated for column 'b' at row 2
|
||||
set sql_mode=default;
|
||||
connection default;
|
||||
drop table t1;
|
||||
set debug_sync= reset;
|
||||
|
@ -810,8 +810,9 @@ insert into t1(a) values ('foobar');
|
||||
--send set debug_sync= 'now wait_for downgraded'
|
||||
|
||||
--connection con2
|
||||
set sql_mode='';
|
||||
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
|
||||
--send alter ignore table t1 drop b, add b char(3) as (a) stored, algorithm=copy, lock=none
|
||||
--send alter table t1 drop b, add b char(3) as (a) stored, algorithm=copy, lock=none
|
||||
|
||||
--connection default
|
||||
--reap
|
||||
@ -820,6 +821,7 @@ set debug_sync= 'now signal goforit';
|
||||
|
||||
--connection con2
|
||||
--reap
|
||||
set sql_mode=default;
|
||||
--connection default
|
||||
drop table t1;
|
||||
set debug_sync= reset;
|
||||
|
@ -10029,6 +10029,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
|
||||
if (alter_info->requested_lock > Alter_info::ALTER_TABLE_LOCK_NONE
|
||||
|| alter_info->flags & ALTER_DROP_SYSTEM_VERSIONING
|
||||
|| thd->lex->sql_command == SQLCOM_OPTIMIZE
|
||||
|| ignore
|
||||
|| alter_info->algorithm(thd) > Alter_info::ALTER_TABLE_ALGORITHM_COPY)
|
||||
online= false;
|
||||
|
||||
|
Reference in New Issue
Block a user