[MDEV-6293] Unable to repair a SPIDER table Created: 2014-06-02  Updated: 2022-11-03  Resolved: 2022-11-03

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.0.11
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Federico Razzoli Assignee: Nayuta Yanagisawa (Inactive)
Resolution: Duplicate Votes: 0
Labels: spider


 Description   

After playing with MDEV-6269, I've got a damaged SPIDER table. I cannot find a way to repair it, so I believe it is a bug or a missing functionality:

MariaDB [test]> DROP TABLE user;
ERROR 1051 (42S02): Unknown table 'test.user'
MariaDB [test]> REPAIR TABLE user;
+-----------+--------+----------+---------------------------------+
| Table     | Op     | Msg_type | Msg_text                        |
+-----------+--------+----------+---------------------------------+
| test.user | repair | Error    | Table 'test.user' doesn't exist |
| test.user | repair | status   | Operation failed                |
+-----------+--------+----------+---------------------------------+
2 rows in set (0.00 sec)

Also, mysql.spider_tables is empty.

It seems that I am not the only one who had this problem:
https://lists.launchpad.net/maria-discuss/msg01626.html



 Comments   
Comment by Kentoku Shiba (Inactive) [ 2019-06-03 ]

I tried to reproduce this using the following procedure. After restarting MariaDB, user.frm file is lost. Is this issue already fixed?
In the other hands, mysql.spider_tables table needs to repair after restarting. This issue is fixed at MDEV-16250.

MariaDB [test]> CREATE OR REPLACE TABLE user(
-> `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT ''
-> )ENGINE = SPIDER
-> COMMENT 'host "127.0.0.1", port "3312", user "root", password "", database "mysql", table "user"';
Query OK, 0 rows affected (0.006 sec)

MariaDB [test]> show create table user\G
//*************************** 1. row ***************************
Table: user
Create Table: CREATE TABLE `user` (
`Host` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''
) ENGINE=SPIDER DEFAULT CHARSET=utf8mb4 COMMENT='host "127.0.0.1", port "3312", user "root", password "", database "mysql", table "user"'
1 row in set (0.000 sec)

MariaDB [test]> CREATE OR REPLACE TABLE user
-> ENGINE = SPIDER
-> COMMENT 'host "127.0.0.1", port "3312", user "root", password "", database "mysql", table "user"';
ERROR 2013 (HY000): Lost connection to MySQL server during query
MariaDB [test]> show create table user\G
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 2
Current database: test

ERROR 1146 (42S02): Table 'test.user' doesn't exist

Comment by Sergei Golubchik [ 2022-11-03 ]

After MDEV-11412 DROP should always work.
After MDEV-25292 CREATE OR REPLACE won't destroy the existing table if creation failed.

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