summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/federated/assisted_discovery.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
commit06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/federated/assisted_discovery.test
parentInitial commit. (diff)
downloadmariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz
mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/federated/assisted_discovery.test')
-rw-r--r--mysql-test/suite/federated/assisted_discovery.test61
1 files changed, 61 insertions, 0 deletions
diff --git a/mysql-test/suite/federated/assisted_discovery.test b/mysql-test/suite/federated/assisted_discovery.test
new file mode 100644
index 00000000..bd32878f
--- /dev/null
+++ b/mysql-test/suite/federated/assisted_discovery.test
@@ -0,0 +1,61 @@
+source include/federated.inc;
+source have_federatedx.inc;
+
+connection slave;
+
+CREATE TABLE t1 (
+ `id` int(20) primary key,
+ `group` int NOT NULL default 1,
+ `a\\b` int NOT NULL default 2,
+ `a\\` int unsigned,
+ `name` varchar(32) default 'name')
+ DEFAULT CHARSET=latin1;
+
+connection master;
+
+evalp CREATE TABLE t1 ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (id, name) VALUES (1, 'foo');
+INSERT INTO t1 (id, name) VALUES (2, 'fee');
+--sorted_result
+SELECT * FROM t1;
+DROP TABLE t1;
+
+connection slave;
+--sorted_result
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-11311 Create federated table does not work as expected
+--echo #
+create table t1 (
+ a bigint(20) not null auto_increment,
+ b bigint(20) not null,
+ c tinyint(4) not null,
+ d varchar(4096) not null,
+ primary key (a),
+ key (b,c,d(255))
+);
+show create table t1;
+
+connection master;
+evalp create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+show create table t1;
+drop table t1;
+
+connection slave;
+drop table t1;
+
+--echo #
+--echo # MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon table discovery with non-existent database
+--echo #
+connection master;
+--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+evalp create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
+
+source include/federated_cleanup.inc;
+