mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-14767 system_versioning_alter_history breaks ALTER replication
Vers SQL: force VERS_ALTER_HISTORY_KEEP behavior in the slave thread
This commit is contained in:
committed by
Sergei Golubchik
parent
3f4d03b0dd
commit
dd7d169593
@ -45,7 +45,7 @@ sync_slave_with_master;
|
||||
select * from t1;
|
||||
select * from t1 for system_time all;
|
||||
|
||||
# check unversioned -> versioned replication
|
||||
--echo # check unversioned -> versioned replication
|
||||
connection master;
|
||||
create or replace table t1 (x int primary key);
|
||||
sync_slave_with_master;
|
||||
@ -69,7 +69,7 @@ sync_slave_with_master;
|
||||
select * from t1;
|
||||
select * from t1 for system_time all;
|
||||
|
||||
# same thing (UPDATE, DELETE), but without PK
|
||||
--echo # same thing (UPDATE, DELETE), but without PK
|
||||
connection master;
|
||||
create or replace table t1 (x int);
|
||||
sync_slave_with_master;
|
||||
@ -88,7 +88,7 @@ sync_slave_with_master;
|
||||
select * from t1;
|
||||
select * from t1 for system_time all;
|
||||
|
||||
# multi-update
|
||||
--echo # multi-update
|
||||
connection master;
|
||||
create or replace table t1 (x int) with system versioning;
|
||||
create or replace table t2 (x int) with system versioning;
|
||||
@ -101,6 +101,35 @@ select * from t2;
|
||||
select * from t1 for system_time all;
|
||||
select * from t2 for system_time all;
|
||||
|
||||
--echo # MDEV-14767 system_versioning_alter_history breaks ALTER replication
|
||||
--echo ## Case 1: KEEP on the master, ALTER will work on the slave
|
||||
connection master;
|
||||
create or replace table t1 (a int) with system versioning;
|
||||
set system_versioning_alter_history= KEEP;
|
||||
alter table t1 add column b int;
|
||||
sync_slave_with_master;
|
||||
--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
|
||||
show create table t1;
|
||||
|
||||
--echo ## Case 2: ERROR on the master, it'll fail on the master, the slave won't see it
|
||||
connection master;
|
||||
set system_versioning_alter_history= ERROR;
|
||||
--error ER_VERS_ALTER_NOT_ALLOWED
|
||||
alter table t1 drop column b;
|
||||
sync_slave_with_master;
|
||||
--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
|
||||
show create table t1;
|
||||
|
||||
--echo ## Case 3: table is not versioned on the master, ALTER will work on the slave
|
||||
connection master;
|
||||
create or replace table t1 (a int);
|
||||
sync_slave_with_master;
|
||||
create or replace table t1 (a int) with system versioning;
|
||||
connection master;
|
||||
alter table t1 add column b int;
|
||||
sync_slave_with_master;
|
||||
--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
|
||||
show create table t1;
|
||||
|
||||
connection master;
|
||||
drop table t1, t2;
|
||||
|
Reference in New Issue
Block a user