The synopsis?
Tired of typing URL's for Federated tables? AKA:
CREATE TABLE A (
`a_id` int(20) NOT NULL,
`some_string` varchar(128) NOT NULL default ''
)
ENGINE="FEDERATED" CONNECTION='mysql://joe@foo.example.com:3
With 5.1 you have a new option, the "CREATE SERVER" command.
CREATE SERVER 'master_database' foreign data wrapper 'mysql' options
(HOST '10.0.2.128',
DATABASE 'schema_a',
USER 'joe',
PASSWORD '',
PORT 3306,
SOCKET '',
OWNER 'root');
For the create table all you then need to do is:
CREATE TABLE A (
`a_id` int(20) NOT NULL,
`some_string` varchar(128) NOT NULL default ''
)
ENGINE="FEDERATED" CONNECTION='master_database';
Want to change the definition?
ALTER SERVER 'master_database' options(DATABASE 'schema_b');
So why is this nifty?
Patrick Galbraith provided the functionality.
If you want to play with this, you will need to build 5.1 from source. Lenz recently made post on how to do this.