After renaming a table in TiDB, both the original and new tables are reported as non-existent

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb中的表 rename之后 原表和新表都提示不存在

| username: 天下无贼

After renaming a table in TiDB, both the original and new tables are reported as non-existent. Version 7.1.0. I’ll include the full screenshot.

| username: 天下无贼 | Original post link

I previously tried executing create table asset_bak like asset; insert into asset_bak select * from asset; in TiDB, but after a while, the new table asset_bak no longer existed. Could this be related to TiDB’s GC mechanism?

| username: 像风一样的男子 | Original post link

Misspelled asste_bak, it should be asset_bak.

| username: 天下无贼 | Original post link

Oh, I see.

| username: 天下无贼 | Original post link

I previously tried executing create table asset_bak like asset; insert into asset_bak select * from asset; in TiDB, but after a while, the new table asset_bak no longer existed. Is this related to TiDB’s GC mechanism?

| username: tidb菜鸟一只 | Original post link

asste_bak table name

| username: 天下无贼 | Original post link

Thank you for the rename. My carelessness. I had previously tried executing the following in TiDB: create table asset_bak like asset; insert into asset_bak select * from asset; However, after some time, the new table asset_bak also disappeared. Is this related to TiDB’s GC mechanism? Has anyone encountered this before?

| username: 天下无贼 | Original post link

I can reproduce this issue with copying the table.

| username: Kongdom | Original post link

Why do I feel like the table you created is this kind?

| username: cassblanca | Original post link

Is it possible that you accidentally typed the letters in the wrong order?

| username: 天下无贼 | Original post link

I am currently reproducing the second scenario, it will take some time.

| username: 有猫万事足 | Original post link

GC cannot possibly GC your table as well. :joy:

| username: 裤衩儿飞上天 | Original post link

admin show ddl jobs;
See if there are any records of deleting the asset_bak table.
GC definitely won’t delete it…

| username: Kongdom | Original post link

Did you manage to reproduce it? Waiting eagerly~ :thinking:

| username: Kongdom | Original post link

What a coincidence, how did you reproduce it?

| username: 天下无贼 | Original post link

Problem solved.

| username: 天下无贼 | Original post link

After querying a few times, the copied table was still there at first. After an hour or two, it disappeared when queried again.

| username: MrSylar | Original post link

What version is it? It doesn’t seem like there’s anything special to operate.

| username: 天下无贼 | Original post link

7.1.0 is newer.

| username: MrSylar | Original post link

I’ll test it too.