Bug #30051 CREATE TABLE does not connect and check existence of remote table
Submitted: 25 Jul 2007 18:40 Modified: 1 Aug 2007 16:03
Reporter: Antony Curtis Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Federated storage engine Severity:S3 (Non-critical)
Version:5.0, 5.1 OS:Any
Assigned to: CPU Architecture:Any

[25 Jul 2007 18:40] Antony Curtis
Description:
As a result of Bug#25679, Federated storage engine no longer checks the connection and checks the existence of the remote table when performing a CREATE TABLE operation.

How to repeat:
Simply use CREATE TABLE ... ENGINE=FEDERATED with a connection string referencing a non-existent table or a non-existent host.
[1 Aug 2007 16:03] MySQL Verification Team
Thank you for the bug report.

[miguel@skybr 5.0]$ bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.48-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> CREATE TABLE federated_table (
    ->     id     INT(20) NOT NULL AUTO_INCREMENT,
    ->     name   VARCHAR(32) NOT NULL DEFAULT '',
    ->     other  INT(20) NOT NULL DEFAULT '0',
    ->     PRIMARY KEY  (id),
    ->     INDEX name (name),
    ->     INDEX other_key (other)
    -> )
    -> ENGINE=FEDERATED
    -> DEFAULT CHARSET=latin1
    -> CONNECTION='mysql://root@remote_host:9306/federated/test_table';
Query OK, 0 rows affected (0.06 sec)
[6 Mar 2008 2:17] Patrick Galbraith
I'm Working on a fix for this.

The problem is that ::create no longer verifies that the string it has just parsed will actually connect as "test_foreign_data_source" used to do.

::create needs to call ::real_connect, ::real_connect has to be able to take a share as an argument since get_share has not been called to set up the object's share member, particularly with "select_query"

Chicken and egg situation.
[21 Mar 2008 9:25] Sergey Vojtovich
When fixing this bug, please ensure that a test case for "BUG#34788 - malformed federated connection url is not handled correctly - crashes server !" works as expected. Currently it implies that federated doesn't connect to a remote server.