Bug #109579 no matter what i do,the result always be Tablespace is missing for table
Submitted: 11 Jan 2023 6:50 Modified: 11 Jan 2023 13:22
Reporter: charming princess Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.31-0ubuntu0.20.04.1 OS:Ubuntu
Assigned to: CPU Architecture:x86
Tags: Tablespace is missing

[11 Jan 2023 6:50] charming princess
Description:
one day,I open the database, open the table,it says:
SQL error [1812] [HY000]: Tablespace is missing for table

check the /var/lib/mysql,ibd file is missing.

I didn't have backup, bc it's test database.

check the /var/log/mysql,it says:
[ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
[ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
[ERROR] [MY-012216] [InnoDB] Cannot open datafile for read-only: './***/***.ibd' OS error: 71

my question is ,I can't operate this table,even drop

I tried following operation:

drop table ***
alter table *** discard tablespace

It all returns Tablespace is missing for table.

It seems i have to change the table name.....

I search bugs and https://dba.stackexchange.com/,didn't found any .

How to repeat:
can't repeat,

manually delete the ide file in other database, drob table works fine

Suggested fix:
let me drop the table
[11 Jan 2023 6:52] charming princess
truncate table would make the mysql server crush and reboot,here is the log :

2023-01-11T06:51:46Z UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=42fffe844f4ae6ac576008e5df6b737ffd4d4eef
Thread pointer: 0x7f70b4061ee0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f724cfbcc50 thread_stack 0x100000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x55749d9f2f11]
/usr/sbin/mysqld(print_fatal_signal(int)+0x39b) [0x55749c88497b]
/usr/sbin/mysqld(handle_fatal_signal+0xa5) [0x55749c884a35]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x143c0) [0x7f72c2ad13c0]
/usr/sbin/mysqld(ha_innobase::truncate_impl(char const*, TABLE*, dd::Table*)+0x1e8) [0x55749da57478]
/usr/sbin/mysqld(ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, bool, bool, dd::Table*)+0xb79) [0x55749c99a4b9]
/usr/sbin/mysqld(Sql_cmd_truncate_table::truncate_base(THD*, TABLE_LIST*)+0x889) [0x55749cc2eb69]
/usr/sbin/mysqld(Sql_cmd_truncate_table::execute(THD*)+0x55) [0x55749cc2f895]
/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0xa97) [0x55749c7171a7]
/usr/sbin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x434) [0x55749c71bf34]
/usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x1d5c) [0x55749c71e1bc]
/usr/sbin/mysqld(do_command(THD*)+0x207) [0x55749c71f4c7]
/usr/sbin/mysqld(+0x11485d8) [0x55749c8755d8]
/usr/sbin/mysqld(+0x2839d7d) [0x55749df66d7d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7f72c2ac5609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f72c2696163]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f70b404f9c0): is an invalid pointer
Connection ID (thread ID): 107881
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
[11 Jan 2023 13:22] MySQL Verification Team
Hi charming princess,

Thank you for your bug report.

However, this is not a bug.

MySQL does not support a physical removal of any file in it's data directory.

Not a bug.