Description:
MySQL allows to create a federated table using create server
(see MySQL doc for details: https://dev.mysql.com/doc/refman/5.7/en/federated-create-server.html)
When you try to use the MySQL Workbench Feature "Synchronize with Any Source" (or Migration Wizard), in order to sync a schema, the create statement for federated tables using create server (as described above) is incomplete - the connection information with the server (mysql.servers) is missing in the sync-script.
Example Source-Side (Correct):
CREATE TABLE `test` (
`idtest` int(11) NOT NULL AUTO_INCREMENT,
`testtext` varchar(150) NOT NULL,
PRIMARY KEY (`idtest`)
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb4 CONNECTION='remoteserver/test';
#remoteserver is defined in mysql.servers
WB output using sync with any source:
CREATE TABLE `test` (
`idtest` int(11) NOT NULL AUTO_INCREMENT,
`testtext` varchar(150) NOT NULL,
PRIMARY KEY (`idtest`)
) ENGINE=FEDERATED DEFAULT CHARSET=utf8mb4;
The script fails without stating the connection.
Fun Fact: If you right click on the federated table (source-side), click on "copy to clipboard" and then click on create-statement, the connection is listed correctly.
How to repeat:
Create the table mentioned above in your db + create necessary server (see doc-link above).
Using feature sync with any source, in order to create the same federated table in another schema.
Rest is described above.
Suggested fix:
Include connection in the sync-script.
Maybe the same code as for "copy to clipboard => create statement" can be reused here?