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

Table discovery hides the real problem behind ER_SQL_DISCOVER_ERROR

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
    • 10.5, 10.6
    • None

    Description

      INSTALL SONAME 'ha_federatedx'; 
      eval create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);
       
      CREATE TABLE t (a INT, g POINT);
      --error ER_SQL_DISCOVER_ERROR
      CREATE TABLE t_fed ENGINE=FEDERATED CONNECTION="s/t";
      SHOW WARNINGS;
       
      # Cleanup
      DROP TABLE t;
      DROP SERVER s;
      UNINSTALL SONAME 'ha_federatedx';
      

      The table discovery fails because Federated does not support GIS. The problem is the error message. To avoid suspicion that it's MTR-induced truncation, here is the output from the client:

      10.10 a27bfb2a872

      MariaDB [test]> CREATE TABLE t_fed ENGINE=FEDERATED CONNECTION="s/t";
      ERROR 1939 (HY000): Engine FEDERATED failed to discover table `test`.`t_fed` with 'CREATE TABLE `t` (
        `a` int(11) DEFAULT NULL,
        `g` point DEFAULT NULL
      ) CONNECTION='s/t''
      

      SHOW WARNINGS show four errors, the first being ER_CHECK_NOT_IMPLEMENTED and the above ER_SQL_DISCOVER_ERROR being the second, so it's not quite clear why it ends up in the client. On the bright side, it's better than the other two which are even more generic.

      MariaDB [test]> show warnings;
      +-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Level | Code | Message                                                                                                                                                    |
      +-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Error | 1178 | The storage engine for the table doesn't support GEOMETRY                                                                                                  |
      | Error | 1939 | Engine FEDERATED failed to discover table `test`.`t_fed` with 'CREATE TABLE `t` (
        `a` int(11) DEFAULT NULL,
        `g` point DEFAULT NULL
      ) CONNECTION='s/t'' |
      | Error | 1429 | Unable to connect to foreign data source:                                                                                                                  |
      | Error | 1030 | Got error 168 "Unknown (generic) error from engine" from storage engine FEDERATED                                                                          |
      +-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
      

      Attachments

        Activity

          For Archive engine:

          3e03a45aa4c69e5aa76c9396547797a895a98edc

          MariaDB [test]> alter table t add vector(v);
          ERROR 1939 (HY000): Engine ARCHIVE failed to discover table `test`.`t` with 'CREATE TABLE i (                     layer tinyint not null,            tref varbinary(8),                vec blob not null,                 neighbors blob not null,           unique (tref),                     key (layer))                     '
          MariaDB [test]> show warnings;
          +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
          | Level | Code | Message                                                                                                                                                                                                                                                                                                        |
          +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
          | Error | 1069 | Too many keys specified; max 1 keys allowed                                                                                                                                                                                                                                                                    |
          | Error | 1939 | Engine ARCHIVE failed to discover table `test`.`t` with 'CREATE TABLE i (                     layer tinyint not null,            tref varbinary(8),                vec blob not null,                 neighbors blob not null,           unique (tref),                     key (layer))                     ' |
          +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
          2 rows in set (0.000 sec)
          

          elenst Elena Stepanova added a comment - For Archive engine: 3e03a45aa4c69e5aa76c9396547797a895a98edc MariaDB [test]> alter table t add vector(v); ERROR 1939 (HY000): Engine ARCHIVE failed to discover table `test`.`t` with 'CREATE TABLE i ( layer tinyint not null, tref varbinary(8), vec blob not null, neighbors blob not null, unique (tref), key (layer)) ' MariaDB [test]> show warnings; + -------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | + -------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Error | 1069 | Too many keys specified; max 1 keys allowed | | Error | 1939 | Engine ARCHIVE failed to discover table `test`.`t` with 'CREATE TABLE i ( layer tinyint not null, tref varbinary(8), vec blob not null, neighbors blob not null, unique (tref), key (layer)) ' | + -------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.000 sec)

          For Connect:

          MariaDB [test]> create or replace table t (a int primary key, v vector(1) not null, vector(v)) engine=Connect table_type=DOS;
          ERROR 1939 (HY000): Engine CONNECT failed to discover table `test`.`t` with 'CREATE TABLE i (                     layer tinyint not null,            tref varbinary(4),                vec blob not null,                 neighbors blob not null,           unique (tref),                     key (layer))    
          

          elenst Elena Stepanova added a comment - For Connect: MariaDB [test]> create or replace table t (a int primary key , v vector(1) not null , vector(v)) engine= Connect table_type=DOS; ERROR 1939 (HY000): Engine CONNECT failed to discover table `test`.`t` with ' CREATE TABLE i ( layer tinyint not null , tref varbinary(4), vec blob not null , neighbors blob not null , unique (tref), key (layer))

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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