Skip to content

show tables get wrong result after restart tidb and a snapshot read #55835

@tiancaiamao

Description

@tiancaiamao

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. use infoschema v2
set @@global.tidb_schema_cache_size = '512MB';
  1. create table t and drop it, record the timestamp when t is available
use test;
create table t (id int);
select now();  ## get  '2024-09-04 09:48:54'
drop table t;
  1. restart tidb

  2. after a snapshot read, show tables goes wrong.

mysql> show tables;
Empty set (0.00 sec)

mysql> select * from t as of timestamp '2024-09-04 09:48:54';
Empty set (0.00 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t              |
+----------------+
1 row in set (0.00 sec)

2. What did you expect to see? (Required)

mysql> show tables;
Empty set (0.00 sec)

mysql> show full tables;
Empty set (0.00 sec)

mysql> select * from information_schema.tables where table_schema = 't';
Empty set (0.00 sec)

3. What did you see instead (Required)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t              |
+----------------+
1 row in set (0.00 sec)

mysql> show full tables;
Empty set (0.00 sec)

mysql> select * from information_schema.tables where table_schema = 't';
Empty set (0.00 sec)

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions