`Auto_increment` value in `show table status` is incorrect after create table or set auto_increment
- 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)
```
mysql> create table t(a int primary key auto_increment);
Query OK, 0 rows affected (0.53 sec)
mysql> show table status like "t";
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------+----------+----------------+---------+
| t | InnoDB | 10 | Compact | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2025-11-26 06:40:48 | NULL | NULL | utf8mb4_bin | | | |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------+----------+----------------+---------+
1 row in set (0.03 sec)
```
Or
```
mysql> delete from t;
Query OK, 1 row affected (0.03 sec)
mysql> alter table t force auto_increment = 1;
Query OK, 0 rows affected (0.54 sec)
mysql> show table status like "t";
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------+----------+----------------+---------+
| t | InnoDB | 10 | Compact | 1 | 8 | 8 | 0 | 0 | 0 | 0 | 2025-11-26 06:48:41 | NULL | NULL | utf8mb4_bin | | | |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------+----------+----------------+---------+
1 row in set (0.13 sec)
```
### 2. What did you expect to see? (Required)
The `Auto_increment` column value should be `1`
### 3. What did you see instead (Required)
It is `0`
### 4. What is your TiDB version? (Required)
master
Contributor guide
Assessment
This issue has not been assessed yet.