Skip to content

Commit 221d010

Browse files
committed
MDEV-14789 Creating federated table on versioned table fails
don't allow to discover WITH SYSTEM VERSIONING clause originally by: Aleksey Midenkov
1 parent 5f6b3f9 commit 221d010

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

mysql-test/suite/federated/assisted_discovery.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ t1 CREATE TABLE `t1` (
7272
drop table t1;
7373
connection slave;
7474
drop table t1;
75+
create or replace table t1 (x int) with system versioning;
76+
connection master;
77+
create table t1 engine=federated connection='mysql://root@127.0.0.1:SLAVE_MYPORT/test/t1';
78+
ERROR HY000: Engine FEDERATED failed to discover table `test`.`t1` with 'CREATE TABLE `t1` (
79+
`x` int(11) DEFAULT NULL
80+
) WITH SYSTEM VERSIONING CONNECTION='mysql://root@127.0.0.1:SLAVE_MYPORT/test/t1''
81+
connection slave;
82+
drop table t1;
7583
connection master;
7684
DROP TABLE IF EXISTS federated.t1;
7785
DROP DATABASE IF EXISTS federated;

mysql-test/suite/federated/assisted_discovery.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,14 @@ drop table t1;
5454
connection slave;
5555
drop table t1;
5656

57+
create or replace table t1 (x int) with system versioning;
58+
connection master;
59+
--replace_result $SLAVE_MYPORT SLAVE_MYPORT
60+
--error ER_SQL_DISCOVER_ERROR
61+
eval create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
62+
63+
connection slave;
64+
drop table t1;
65+
5766
source include/federated_cleanup.inc;
5867

sql/table.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,6 +2728,9 @@ static bool sql_unusable_for_discovery(THD *thd, handlerton *engine,
27282728
// ... engine
27292729
if (create_info->db_type && create_info->db_type != engine)
27302730
return 1;
2731+
// ... WITH SYSTEM VERSIONING
2732+
if (create_info->versioned())
2733+
return 1;
27312734

27322735
return 0;
27332736
}

0 commit comments

Comments
 (0)