@@ -458,14 +458,29 @@ type TableInfo struct {
458
458
// 1 for the clustered index created > 5.0.0 RC.
459
459
CommonHandleVersion uint16 `json:"common_handle_version"`
460
460
461
- Comment string `json:"comment"`
462
- AutoIncID int64 `json:"auto_inc_id"`
463
- AutoIdCache int64 `json:"auto_id_cache"` //nolint:revive
464
- AutoRandID int64 `json:"auto_rand_id"`
465
- MaxColumnID int64 `json:"max_col_id"`
466
- MaxIndexID int64 `json:"max_idx_id"`
467
- MaxForeignKeyID int64 `json:"max_fk_id"`
468
- MaxConstraintID int64 `json:"max_cst_id"`
461
+ Comment string `json:"comment"`
462
+ AutoIncID int64 `json:"auto_inc_id"`
463
+
464
+ // Only used by BR when:
465
+ // 1. SepAutoInc() is true
466
+ // 2. The table is nonclustered and has auto_increment column.
467
+ // In that case, both auto_increment_id and tidb_rowid need to be backup & recover.
468
+ // See also https://github.com/pingcap/tidb/issues/46093
469
+ //
470
+ // It should have been named TiDBRowID, but for historial reasons, we do not use separate meta key for _tidb_rowid and auto_increment_id,
471
+ // and field `AutoIncID` is used to serve both _tidb_rowid and auto_increment_id.
472
+ // If we introduce a TiDBRowID here, it could make furthur misunderstanding:
473
+ // in most cases, AutoIncID is _tidb_rowid and TiDBRowID is null
474
+ // but in some cases, AutoIncID is auto_increment_id and TiDBRowID is _tidb_rowid
475
+ // So let's just use another name AutoIncIDExtra to avoid misconception.
476
+ AutoIncIDExtra int64 `json:"auto_inc_id_extra,omitempty"`
477
+
478
+ AutoIdCache int64 `json:"auto_id_cache"` //nolint:revive
479
+ AutoRandID int64 `json:"auto_rand_id"`
480
+ MaxColumnID int64 `json:"max_col_id"`
481
+ MaxIndexID int64 `json:"max_idx_id"`
482
+ MaxForeignKeyID int64 `json:"max_fk_id"`
483
+ MaxConstraintID int64 `json:"max_cst_id"`
469
484
// UpdateTS is used to record the timestamp of updating the table's schema information.
470
485
// These changing schema operations don't include 'truncate table' and 'rename table'.
471
486
UpdateTS uint64 `json:"update_timestamp"`
0 commit comments