Commit 221d010f authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-14789 Creating federated table on versioned table fails

don't allow to discover WITH SYSTEM VERSIONING clause

originally by: Aleksey Midenkov
parent 5f6b3f9c
......@@ -72,6 +72,14 @@ t1 CREATE TABLE `t1` (
drop table t1;
connection slave;
drop table t1;
create or replace table t1 (x int) with system versioning;
connection master;
create table t1 engine=federated connection='mysql://root@127.0.0.1:SLAVE_MYPORT/test/t1';
ERROR HY000: Engine FEDERATED failed to discover table `test`.`t1` with 'CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL
) WITH SYSTEM VERSIONING CONNECTION='mysql://root@127.0.0.1:SLAVE_MYPORT/test/t1''
connection slave;
drop table t1;
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
......
......@@ -54,5 +54,14 @@ drop table t1;
connection slave;
drop table t1;
create or replace table t1 (x int) with system versioning;
connection master;
--replace_result $SLAVE_MYPORT SLAVE_MYPORT
--error ER_SQL_DISCOVER_ERROR
eval create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
connection slave;
drop table t1;
source include/federated_cleanup.inc;
......@@ -2728,6 +2728,9 @@ static bool sql_unusable_for_discovery(THD *thd, handlerton *engine,
// ... engine
if (create_info->db_type && create_info->db_type != engine)
return 1;
// ... WITH SYSTEM VERSIONING
if (create_info->versioned())
return 1;
return 0;
}
......
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