Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 查询information_schema.tables报错Table ‘x x x.xxxx’ doesn’t exist
[Test Environment] TiDB
[TiDB Version] 7.1.0
[Reproduction Path] Not reproduced
[Encountered Problem: Phenomenon and Impact]
dumpling backup data error
dump failed: sql: SELECT COUNT(1) as c FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='SEQUENCE': Error 1146 (42S02): Table 'xxxx.xxxx' doesn't exist
Querying table data in TiDB still reports an error
Confirmed that the table does not exist in the database.
Historical operation: Drop database operation was executed yesterday.
How can this problem be resolved?
Is the system table data incorrect? Was the business table dropped yesterday?
What error is reported in the log?
Why drop the information schema database???
There are quite a few. Yesterday, when deleting the db1 database, there was no error reported, and after deletion, executing the dumpling backup again was also successful.
[2024/03/14 20:02:02.541 +08:00] [ERROR] [terror.go:324] ["encountered error"] [error="write tcp 10.200.xxxx:5000->10.200.xxxx1:53186: write: connection reset by peer"] [stack="github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:324\ngithub.com/pingcap/tidb/server.(*packetIO).writePacket\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/packetio.go:185\ngithub.com/pingcap/tidb/server.(*clientConn).writePacket\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:420\ngithub.com/pingcap/tidb/server.(*clientConn).writeError\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1562\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1194\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:677"]
[2024/03/14 20:02:02.541 +08:00] [ERROR] [terror.go:324] ["encountered error"] [error="connection was bad"] [stack="github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:324\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1195\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:677"]
Didn’t drop the system database.
It looks like there’s an error with your system table.
Try creating a new empty one.
I don’t know why, but creating the table with create table db1.tb1
works 
Create the error table again.
Try to see if it can be reproduced.
Well, let’s first identify the cause; it might not be completely resolved yet.
This is inconsistent with the error “doesn’t exist.” The metadata must be messed up.
Obtained a solution to the problem once.
This is probably the loss of system table information.