[MDEV-29430] 'Got error 1054 when reading table' on SELECT (Spider) Created: 2022-09-01  Updated: 2022-10-20  Resolved: 2022-10-20

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Nayuta Yanagisawa (Inactive)
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-29663 Incorrect, confusing error message: E... Stalled
Relates

 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)



 Comments   
Comment by Ramesh Sivaraman [ 2022-09-01 ]

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'

Comment by Roel Van de Paar [ 2022-09-20 ]

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.

Generated at Thu Feb 08 10:08:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.