| 1 |
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; |
| 2 |
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; |
| 3 |
connection master; |
| 4 |
CREATE DATABASE federated; |
| 5 |
connection slave; |
| 6 |
CREATE DATABASE federated; |
| 7 |
connection slave; |
| 8 |
CREATE TABLE t1 ( |
| 9 |
`id` int(20) primary key, |
| 10 |
`group` int NOT NULL default 1, |
| 11 |
`a\\b` int NOT NULL default 2, |
| 12 |
`a\\` int unsigned, |
| 13 |
`name` varchar(32) default 'name') |
| 14 |
DEFAULT CHARSET=latin1; |
| 15 |
connection master; |
| 16 |
CREATE TABLE t1 ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/test/t1'; |
| 17 |
SHOW CREATE TABLE t1; |
| 18 |
Table Create Table |
| 19 |
t1 CREATE TABLE `t1` ( |
| 20 |
`id` int(20) NOT NULL, |
| 21 |
`group` int(11) NOT NULL DEFAULT 1, |
| 22 |
`a\\b` int(11) NOT NULL DEFAULT 2, |
| 23 |
`a\\` int(10) unsigned DEFAULT NULL, |
| 24 |
`name` varchar(32) DEFAULT 'name', |
| 25 |
PRIMARY KEY (`id`) |
| 26 |
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci CONNECTION='mysql://[email protected]:SLAVE_PORT/test/t1' |
| 27 |
INSERT INTO t1 (id, name) VALUES (1, 'foo'); |
| 28 |
INSERT INTO t1 (id, name) VALUES (2, 'fee'); |
| 29 |
SELECT * FROM t1; |
| 30 |
id group a\\b a\\ name |
| 31 |
1 1 2 NULL foo |
| 32 |
2 1 2 NULL fee |
| 33 |
DROP TABLE t1; |
| 34 |
connection slave; |
| 35 |
SELECT * FROM t1; |
| 36 |
id group a\\b a\\ name |
| 37 |
1 1 2 NULL foo |
| 38 |
2 1 2 NULL fee |
| 39 |
DROP TABLE t1; |
| 40 |
# |
| 41 |
# MDEV-11311 Create federated table does not work as expected |
| 42 |
# |
| 43 |
create table t1 ( |
| 44 |
a bigint(20) not null auto_increment, |
| 45 |
b bigint(20) not null, |
| 46 |
c tinyint(4) not null, |
| 47 |
d varchar(4096) not null, |
| 48 |
primary key (a), |
| 49 |
key (b,c,d(200)) |
| 50 |
); |
| 51 |
show create table t1; |
| 52 |
Table Create Table |
| 53 |
t1 CREATE TABLE `t1` ( |
| 54 |
`a` bigint(20) NOT NULL AUTO_INCREMENT, |
| 55 |
`b` bigint(20) NOT NULL, |
| 56 |
`c` tinyint(4) NOT NULL, |
| 57 |
`d` varchar(4096) NOT NULL, |
| 58 |
PRIMARY KEY (`a`), |
| 59 |
KEY `b` (`b`,`c`,`d`(200)) |
| 60 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 61 |
connection master; |
| 62 |
create table t1 engine=federated connection='mysql://[email protected]:$SLAVE_MYPORT/test/t1'; |
| 63 |
show create table t1; |
| 64 |
Table Create Table |
| 65 |
t1 CREATE TABLE `t1` ( |
| 66 |
`a` bigint(20) NOT NULL AUTO_INCREMENT, |
| 67 |
`b` bigint(20) NOT NULL, |
| 68 |
`c` tinyint(4) NOT NULL, |
| 69 |
`d` varchar(4096) NOT NULL, |
| 70 |
PRIMARY KEY (`a`), |
| 71 |
KEY `b` (`b`,`c`,`d`(200)) |
| 72 |
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci CONNECTION='mysql://[email protected]:SLAVE_PORT/test/t1' |
| 73 |
drop table t1; |
| 74 |
connection slave; |
| 75 |
drop table t1; |
| 76 |
# |
| 77 |
# MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon table discovery with non-existent database |
| 78 |
# |
| 79 |
connection master; |
| 80 |
create table t1 engine=federated connection='mysql://[email protected]:$SLAVE_MYPORT/test/t1'; |
| 81 |
ERROR HY000: Unable to connect to foreign data source: Table 'test.t1' doesn't exist |
| 82 |
connection master; |
| 83 |
DROP TABLE IF EXISTS federated.t1; |
| 84 |
DROP DATABASE IF EXISTS federated; |
| 85 |
connection slave; |
| 86 |
DROP TABLE IF EXISTS federated.t1; |
| 87 |
DROP DATABASE IF EXISTS federated; |