The plan replayer failed to restore the last update version of the histogram correctly
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
1. Get a valid plan replayer with some statistics
2. Check the last update version from the stats JSON file
3. Import it into the new cluster
4. Check the last update version from the `mysql.stats_histograms` table.
### 2. What did you expect to see? (Required)
The version is same.
### 3. What did you see instead (Required)
When we restore the stats, we will insert the histogram with the current timestamp.
### 4. What is your TiDB version? (Required)
```sql
+-----------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------+
| Release Version: v9.0.0-beta.2.pre-45-gbe0ce885d0 |
| Edition: Community |
| Git Commit Hash: be0ce885d0c8d382af209636597e3fce64bc99a7 |
| Git Branch: HEAD |
| UTC Build Time: 2025-07-03 09:59:59 |
| GoVersion: go1.23.10 |
| Race Enabled: false |
| Check Table Before Drop: false |
| Store: tikv |
| Kernel Type: Classic |
+-----------------------------------------------------------+
(END)
```
Contributor guide
Assessment
This issue has not been assessed yet.