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

Incorrect, confusing error message: ERROR 1054 (42S22): Unknown column 't0.c1' in 'field list'

    XMLWordPrintable

Details

    Description

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE USER Spider@localhost IDENTIFIED BY 'PWD1';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD 'PWD1');
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      CREATE TABLE ts (c1 INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      SELECT c1 FROM ts;
      

      Leads to:

      10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)

      10.11.0-dbg>SELECT c1 FROM ts;
      ERROR 1054 (42S22): Unknown column 't0.c1' in 'field list'
      

      1. The t0 is incorrect, there is no t0 defined. This is likely a Spider-internal reference.
      2. The error is confusing. We could replace it with something like:

      ERROR 1054 (42S22): Unknown column 'c1' in parent spider table 't'.
      

      Or similar (assuming that this is the underlaying issue).

      Changing the definition of table t to column name c1 (instead of c) fixes the issue.

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.