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

'Got error 1054 when reading table' on SELECT (Spider)

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
    • N/A
    • None

    Description

      Please update '../socket.sock' to actual path on your instance, or similar (host/port may or may not work)

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE USER Spider@localhost IDENTIFIED BY 'PWD0';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD 'PWD0');
      CREATE TABLE t (c INT);
      CREATE TABLE t2 (a INT KEY,b CHAR(0),c CHAR(0)) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"' COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      SELECT * FROM t2 WHERE a=' 0' AND (a XOR 0);
      

      Leads to (CLI):

      10.11.0 fe1f8f2c6b6f3b8e3383168225f9ae7853028947 (Debug)

      10.11.0-dbg>SELECT * FROM t2 WHERE a=' 0' AND (a XOR 0);
      ERROR 1054 (42S22): Unknown column 'a' in 'field list'
      

      And (Error log):

      10.11.0 fe1f8f2c6b6f3b8e3383168225f9ae7853028947 (Debug)

      2022-09-01 11:44:56 4 [ERROR] Got error 1054 when reading table './test/t2'
      

      Bug confirmed present in:
      MariaDB: 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.2 (dbg), 10.9.2 (opt), 10.10.2 (dbg), 10.10.2 (opt), 10.11.0 (dbg), 10.11.0 (opt)

      Attachments

        Issue Links

          Activity

            ramesh Ramesh Sivaraman added a comment - - edited

            Reproduced the issue on QA box

            10.9.2 a5dc76a051ff908a5f506ed12e8d05311752e5fb (Debug) CLI

            10.9.2-dbg>SELECT * FROM t2 WHERE a=' 0' AND (a XOR 0);
            ERROR 1054 (42S22): Unknown column 'a' in 'field list'
            10.9.2-dbg>
            

            10.9.2 a5dc76a051ff908a5f506ed12e8d05311752e5fb (Debug) Error Log

            2022-09-01  7:54:54 4 [ERROR] Got error 1054 when reading table './test/t2'
            

            ramesh Ramesh Sivaraman added a comment - - edited Reproduced the issue on QA box 10.9.2 a5dc76a051ff908a5f506ed12e8d05311752e5fb (Debug) CLI 10.9.2-dbg>SELECT * FROM t2 WHERE a=' 0' AND (a XOR 0); ERROR 1054 (42S22): Unknown column 'a' in 'field list' 10.9.2-dbg> 10.9.2 a5dc76a051ff908a5f506ed12e8d05311752e5fb (Debug) Error Log 2022-09-01 7:54:54 4 [ERROR] Got error 1054 when reading table './test/t2'

            I also had a look into another testcase showing ERROR 1146 (Table '...' doesn't exist), however that issue proved to be where the underlying table was deleted, but the Spider table was left, in which case it would seem normal to receive such an error when accessing the Spider table (and the error referred to the underlying table, which is correct). As such, I have filtered error 1146 from the runs.

            Roel Roel Van de Paar added a comment - I also had a look into another testcase showing ERROR 1146 (Table '...' doesn't exist), however that issue proved to be where the underlying table was deleted, but the Spider table was left, in which case it would seem normal to receive such an error when accessing the Spider table (and the error referred to the underlying table, which is correct). As such, I have filtered error 1146 from the runs.

            People

              nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.