Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load stats get error: Table '.' doesn't exist #53966

Closed
hey-hoho opened this issue Jun 12, 2024 · 4 comments · Fixed by #57818
Closed

load stats get error: Table '.' doesn't exist #53966

hey-hoho opened this issue Jun 12, 2024 · 4 comments · Fixed by #57818
Assignees
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/statistics severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@hey-hoho
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

When a table does not yet have statistics, use this API to export:

curl -s http://x.x.x.x:10080/stats/dump/test/t1 -o /tmp/t1.json

Then import statistics by load stats ' ' (either the current cluster or a new cluster):

load stats '/tmp/t1.json';

I get error:

mysql> load stats '/tmp/t1.json';
ERROR 1146 (42S02): Table '.' doesn't exist

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

SQL passed.

3. What did you see instead (Required)

ERROR 1146 (42S02): Table '.' doesn't exist

4. What is your TiDB version? (Required)

Release Version: v7.5.1
Edition: Community
Git Commit Hash: 7d16cc79e81bbf573124df3fd9351c26963f3e70
Git Branch: heads/refs/tags/v7.5.1
UTC Build Time: 2024-02-27 14:28:32
GoVersion: go1.21.6
Race Enabled: false
Check Table Before Drop: false
Store: tikv
@hey-hoho hey-hoho added the type/bug The issue is confirmed as a bug. label Jun 12, 2024
@jebter jebter added the sig/planner SIG: Planner label Jun 14, 2024
@ti-chi-bot ti-chi-bot bot added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Nov 1, 2024
@Rustin170506
Copy link
Member

Could you share your JSON file or the reproducible SQL here?

@hey-hoho
Copy link
Author

@Rustin170506 this is my reproduce steps:

[root@localhost ~]# curl -s http://10.x.xx.xx:10080/stats/dump/test/t1 -o /tmp/t1.json
[root@localhost ~]#
[root@localhost ~]# cat /tmp/t1.json
null[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# mysql -uroot -P4000 -h10.x.xx.xx -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1307071
Server version: 5.7.25-TiDB-v7.1.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> load stats '/tmp/t1.json';
ERROR 1146 (42S02): Table '.' doesn't exist
MySQL [(none)]>
MySQL [(none)]>
MySQL [(none)]> show create table test.t1;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                          |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `id1` int(11) DEFAULT NULL,
  `id2` int(11) DEFAULT NULL,
  `id3` int(11) DEFAULT NULL,
  `na` char(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL [(none)]>

@King-Dylan
Copy link
Contributor

I can try to fix it.

@King-Dylan
Copy link
Contributor

Image

@hawkingrei hawkingrei added affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. and removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 labels Dec 4, 2024
@Rustin170506 Rustin170506 moved this to 🏊WIP in 😆Stats Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/statistics severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants