Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10069

Auto-discovery of columns not working with FederatedX engine

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.1.14
    • N/A
    • None
    • 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';
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dirichs Martin Dirichs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.