2016-03-25 20:51:22 +04:00
|
|
|
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
|
|
|
|
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
|
|
|
connection master;
|
2013-04-09 16:19:18 +02:00
|
|
|
CREATE DATABASE federated;
|
2016-03-25 20:51:22 +04:00
|
|
|
connection slave;
|
2013-04-09 16:19:18 +02:00
|
|
|
CREATE DATABASE federated;
|
2016-03-25 20:51:22 +04:00
|
|
|
connection slave;
|
2013-04-09 16:19:18 +02:00
|
|
|
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;
|
2016-03-25 20:51:22 +04:00
|
|
|
connection master;
|
2013-04-09 16:19:18 +02:00
|
|
|
CREATE TABLE t1 ENGINE=FEDERATED
|
|
|
|
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
|
|
|
`id` int(20) NOT NULL,
|
2016-07-19 11:18:58 +02:00
|
|
|
`group` int(11) NOT NULL DEFAULT 1,
|
|
|
|
`a\\b` int(11) NOT NULL DEFAULT 2,
|
2013-04-09 16:19:18 +02:00
|
|
|
`a\\` int(10) unsigned DEFAULT NULL,
|
|
|
|
`name` varchar(32) DEFAULT 'name',
|
|
|
|
PRIMARY KEY (`id`)
|
|
|
|
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'
|
|
|
|
INSERT INTO t1 (id, name) VALUES (1, 'foo');
|
|
|
|
INSERT INTO t1 (id, name) VALUES (2, 'fee');
|
|
|
|
SELECT * FROM t1;
|
|
|
|
id group a\\b a\\ name
|
|
|
|
1 1 2 NULL foo
|
|
|
|
2 1 2 NULL fee
|
|
|
|
DROP TABLE t1;
|
2016-03-25 20:51:22 +04:00
|
|
|
connection slave;
|
2013-04-09 16:19:18 +02:00
|
|
|
SELECT * FROM t1;
|
|
|
|
id group a\\b a\\ name
|
|
|
|
1 1 2 NULL foo
|
|
|
|
2 1 2 NULL fee
|
|
|
|
DROP TABLE t1;
|
2016-03-25 20:51:22 +04:00
|
|
|
connection master;
|
2013-04-09 16:19:18 +02:00
|
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
|
|
DROP DATABASE IF EXISTS federated;
|
2016-03-25 20:51:22 +04:00
|
|
|
connection slave;
|
2013-04-09 16:19:18 +02:00
|
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
|
|
DROP DATABASE IF EXISTS federated;
|