From 4c1fd339717c7c3de09e209ece2ff7c9417bb3ec Mon Sep 17 00:00:00 2001 From: Evan Zhou Date: Sat, 9 May 2020 18:15:08 +0800 Subject: [PATCH 1/2] model: add IsCommonHandle field on TableInfo To support clustered index. https://github.com/pingcap/tidb/pull/17044 --- model/model.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/model/model.go b/model/model.go index 4b9229d0e..bcd3bad57 100644 --- a/model/model.go +++ b/model/model.go @@ -216,7 +216,12 @@ type TableInfo struct { Indices []*IndexInfo `json:"index_info"` ForeignKeys []*FKInfo `json:"fk_info"` State SchemaState `json:"state"` - PKIsHandle bool `json:"pk_is_handle"` + // PKIsHandle is true when primary key is a single integer column. + PKIsHandle bool `json:"pk_is_handle"` + // IsCommonHandle is true when clustered index feature is + // enabled and the primary key is not a single integer column. + IsCommonHandle bool `json:"is_common_handle"` + Comment string `json:"comment"` AutoIncID int64 `json:"auto_inc_id"` AutoIdCache int64 `json:"auto_id_cache"` From d207a9d545de1ac4bce5d4aef7d4a25ec39a9c3d Mon Sep 17 00:00:00 2001 From: Evan Zhou Date: Sun, 10 May 2020 10:16:40 +0800 Subject: [PATCH 2/2] fix go fmt --- model/model.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/model/model.go b/model/model.go index bcd3bad57..97efe4322 100644 --- a/model/model.go +++ b/model/model.go @@ -222,12 +222,12 @@ type TableInfo struct { // enabled and the primary key is not a single integer column. IsCommonHandle bool `json:"is_common_handle"` - Comment string `json:"comment"` - AutoIncID int64 `json:"auto_inc_id"` - AutoIdCache int64 `json:"auto_id_cache"` - AutoRandID int64 `json:"auto_rand_id"` - MaxColumnID int64 `json:"max_col_id"` - MaxIndexID int64 `json:"max_idx_id"` + Comment string `json:"comment"` + AutoIncID int64 `json:"auto_inc_id"` + AutoIdCache int64 `json:"auto_id_cache"` + AutoRandID int64 `json:"auto_rand_id"` + MaxColumnID int64 `json:"max_col_id"` + MaxIndexID int64 `json:"max_idx_id"` // UpdateTS is used to record the timestamp of updating the table's schema information. // These changing schema operations don't include 'truncate table' and 'rename table'. UpdateTS uint64 `json:"update_timestamp"`