Querying information_schema.tables results in error: Table 'x x x.xxxx' doesn't exist

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

| username: TiDBer_yyy

[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?

| username: ShawnYan | Original post link

Is the system table data incorrect? Was the business table dropped yesterday?

What error is reported in the log?

| username: oceanzhang | Original post link

Why drop the information schema database???

| username: TiDBer_yyy | Original post link

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"]
| username: TiDBer_yyy | Original post link

Didn’t drop the system database.

| username: tidb狂热爱好者 | Original post link

It looks like there’s an error with your system table.

| username: TiDBer_yyy | Original post link

How to handle it, boss?

| username: TiDB_C罗 | Original post link

Try creating a new empty one.

| username: TiDBer_yyy | Original post link

I don’t know why, but creating the table with create table db1.tb1 works :rofl:

| username: YuchongXU | Original post link

Create the error table again.

| username: TiDB_C罗 | Original post link

Try to see if it can be reproduced.

| username: TiDBer_yyy | Original post link

Well, let’s first identify the cause; it might not be completely resolved yet.

| username: 这里介绍不了我 | Original post link

Can it be done this way?

| username: 江湖故人 | Original post link

This is inconsistent with the error “doesn’t exist.” The metadata must be messed up.

| username: TIDB-Learner | Original post link

Obtained a solution to the problem once.

| username: TiDBer_yyy | Original post link

A solution to a problem.

| username: oceanzhang | Original post link

This is probably the loss of system table information.

| username: oceanzhang | Original post link

Just say it!

| username: zhang_2023 | Original post link

How was it resolved?

| username: TiDBer_yyy | Original post link

Recreate the table.