mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31297 Create table as select on system versioned tables do not
work consistently on replication Row-based replication does not execute CREATE .. SELECT but instead CREATE TABLE. CREATE .. SELECT creates implict system fields on unusual place: in-between declared fields and select fields. That was done because select_field_pos logic requires select fields go last in create_list. So, CREATE .. SELECT on master and CREATE TABLE on slave create system fields on different positions and replication gets field mismatch. To fix this we've changed CREATE .. SELECT to create implicit system fields on usual place in the end and updated select_field_pos for handling this case.
This commit is contained in:
@@ -56,4 +56,19 @@ drop table t1;
|
||||
--remove_files_wildcard $TMP *.txt
|
||||
--remove_files_wildcard $TMP *.sql
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31297 Create table as select on system versioned tables do not work consistently on replication
|
||||
--echo #
|
||||
--connection master
|
||||
create table t engine=innodb with system versioning as select 1 as i;
|
||||
show create table t;
|
||||
select * from t;
|
||||
|
||||
--sync_slave_with_master
|
||||
show create table t;
|
||||
select * from t;
|
||||
|
||||
--connection master
|
||||
drop table t;
|
||||
|
||||
--source include/rpl_end.inc
|
||||
|
Reference in New Issue
Block a user