2016-03-25 17:51:22 +01:00
|
|
|
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
|
|
|
|
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
|
|
|
connection master;
|
2015-12-06 01:48:07 +01:00
|
|
|
CREATE DATABASE federated;
|
2016-03-25 17:51:22 +01:00
|
|
|
connection slave;
|
2015-12-06 01:48:07 +01:00
|
|
|
CREATE DATABASE federated;
|
|
|
|
connection slave;
|
|
|
|
create table t1 (foo int, bar int);
|
|
|
|
connection master;
|
|
|
|
create server 's1' foreign data wrapper 'mysql' options
|
|
|
|
(HOST 'localhost',
|
|
|
|
DATABASE 'test',
|
|
|
|
USER 'root',
|
|
|
|
PASSWORD '',
|
|
|
|
SOCKET 'SLAVE_MYSOCK');
|
|
|
|
create table t1 (foo integer, bar integer) engine=federated
|
|
|
|
connection='s1';
|
|
|
|
select * from t1;
|
|
|
|
foo bar
|
|
|
|
connection slave;
|
2019-03-25 07:02:22 +01:00
|
|
|
# restart
|
2015-12-06 01:48:07 +01:00
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
|
|
drop server s1;
|
|
|
|
connection slave;
|
|
|
|
drop table t1;
|
|
|
|
connection master;
|
|
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
|
|
DROP DATABASE IF EXISTS federated;
|
|
|
|
connection slave;
|
|
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
|
|
DROP DATABASE IF EXISTS federated;
|