You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create a table with auto_increment pk
create table t (id int auto_increment primary key, txt varchar(25)) auto_id_cache=1;
insert into t(txt) values('aaa');
mysql> show table t next_row_id;
+---------+------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE |
+---------+------------+-------------+--------------------+----------------+
| br_test | t | id | 1 | _TIDB_ROWID |
| br_test | t | id | 2 | AUTO_INCREMENT |
+---------+------------+-------------+--------------------+----------------+
2 rows in set (0.18 sec)
after pause& resume
mysql> show table t next_row_id;
+----------+---------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE |
+----------+---------------+-------------+--------------------+----------------+
| br_test | t | _tidb_rowid | 1 | _TIDB_ROWID |
| br_test | t | _tidb_rowid | 1 | AUTO_INCREMENT |<< wrong value
+----------+---------------+-------------+--------------------+----------------+
2 rows in set (0.20 sec)
insert data
mysql> insert into t(txt) values('aaa');
Query OK, 1 row affected (0.19 sec)
-- row with id=2 inserted
After insert , the auto_increment is updated to correct value. However we have no way to confirm the correct value at step 1 without insert.
mysql> show table t next_row_id;
+----------+---------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE |
+----------+---------------+-------------+--------------------+----------------+
| br_test | t | _tidb_rowid | 1 | _TIDB_ROWID |
| br_test | t | _tidb_rowid | 3 | AUTO_INCREMENT |<< correct value
+----------+---------------+-------------+--------------------+----------------+
2 rows in set (0.17 sec)
2. What did you expect to see? (Required)
At step 2, show AUTO_INCREMENT as the correct value which is 2.
3. What did you see instead (Required)
1 was shown at step2.
4. What is your TiDB version? (Required)
v7.1.1
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create a table with auto_increment pk
create table t (id int auto_increment primary key, txt varchar(25)) auto_id_cache=1;
insert into t(txt) values('aaa');
mysql> show table t next_row_id;
+---------+------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE |
+---------+------------+-------------+--------------------+----------------+
| br_test | t | id | 1 | _TIDB_ROWID |
| br_test | t | id | 2 | AUTO_INCREMENT |
+---------+------------+-------------+--------------------+----------------+
2 rows in set (0.18 sec)
after pause& resume
mysql> show table t next_row_id;
+----------+---------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE |
+----------+---------------+-------------+--------------------+----------------+
| br_test | t | _tidb_rowid | 1 | _TIDB_ROWID |
| br_test | t | _tidb_rowid | 1 | AUTO_INCREMENT |<< wrong value
+----------+---------------+-------------+--------------------+----------------+
2 rows in set (0.20 sec)
insert data
mysql> insert into t(txt) values('aaa');
Query OK, 1 row affected (0.19 sec)
mysql> show table t next_row_id;
+----------+---------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE |
+----------+---------------+-------------+--------------------+----------------+
| br_test | t | _tidb_rowid | 1 | _TIDB_ROWID |
| br_test | t | _tidb_rowid | 3 | AUTO_INCREMENT |<< correct value
+----------+---------------+-------------+--------------------+----------------+
2 rows in set (0.17 sec)
2. What did you expect to see? (Required)
At step 2, show AUTO_INCREMENT as the correct value which is 2.
3. What did you see instead (Required)
1 was shown at step2.
4. What is your TiDB version? (Required)
v7.1.1
The text was updated successfully, but these errors were encountered: