[MDEV-10069] Auto-discovery of columns not working with FederatedX engine Created: 2016-05-14  Updated: 2016-05-14  Resolved: 2016-05-14

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Federated
Affects Version/s: 10.1.14
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Martin Dirichs Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

MariaDB 10.1.14, downloaded from MariaDB Foundation builds
Ubuntu 14.04 LTS



 Description   

Using the FederatedX engine to refer to a table in another MariaDB database without specifying all columns explicitly fails with error

MariaDB [db2]> create table test_table engine=federated connection='mysql://user:passwd@localhost/db1/test_table';
ERROR 1113 (42000): A table must have at least 1 column

This is not in line with the description in the MariaDB documentation which states that table structure could be inferred from the original table connect to.

The steps to reproduce can be taken directly from the above mentioned documentation:

-- In db1:
CREATE TABLE test_table (
  id     int(20) NOT NULL auto_increment,
  name   varchar(32) NOT NULL default '',
  other  int(20) NOT NULL default '0',
  PRIMARY KEY  (id),
  KEY name (name),
  KEY other_key (other))
DEFAULT CHARSET=latin1;
 
-- In db2, this fails:
CREATE TABLE test_table ENGINE=FEDERATED DEFAULT CHARSET=latin1
CONNECTION='mysql://user_x:pass_y@localhost/db1/test_table';
 
-- However, this works in db2:
CREATE TABLE test_table (
  id     int(20) NOT NULL auto_increment,
  name   varchar(32) NOT NULL default '',
  other  int(20) NOT NULL default '0',
  PRIMARY KEY  (id),
  KEY name (name),
  KEY other_key (other)
) ENGINE=FEDERATED
DEFAULT CHARSET=latin1
CONNECTION='mysql://user_x:pass_y@localhost/db1/test_table';



 Comments   
Comment by Elena Stepanova [ 2016-05-14 ]

dirichs,

Are you sure you are using FederatedX engine, as opposed to Federated?
MariaDB has both, and FederatedX supports assisted discovery, while Federated does not.

Could you please paste the output of SHOW ENGINES?

Thanks.

Comment by Martin Dirichs [ 2016-05-14 ]

You are right. I made sure that the federated plugin is loaded from 'ha_federatedx' library and now it works. I tried that before but did not restart the server, so the Federated engine was still in place.
Thanks a lot, that solved the issue for me!

Generated at Thu Feb 08 07:39:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.