From 00fe11648edc8a004469d4f3a724e390fc721858 Mon Sep 17 00:00:00 2001 From: AilinKid <314806019@qq.com> Date: Tue, 17 Mar 2020 20:23:21 +0800 Subject: [PATCH] fmt --- model/ddl.go | 2 +- model/model.go | 20 ++++++++++---------- parser_test.go | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/model/ddl.go b/model/ddl.go index fc39e0698..1e270e741 100644 --- a/model/ddl.go +++ b/model/ddl.go @@ -112,7 +112,7 @@ var actionMap = map[ActionType]string{ ActionCreateSequence: "create sequence", ActionAlterSequence: "alter sequence", ActionDropSequence: "drop sequence", - ActionModifyTableAutoIdCache: "modify auto increment cache", + ActionModifyTableAutoIdCache: "modify auto id cache", } // String return current ddl action in string diff --git a/model/model.go b/model/model.go index b7ea15046..42cdc0c42 100644 --- a/model/model.go +++ b/model/model.go @@ -212,16 +212,16 @@ type TableInfo struct { Charset string `json:"charset"` Collate string `json:"collate"` // Columns are listed in the order in which they appear in the schema. - Columns []*ColumnInfo `json:"cols"` - Indices []*IndexInfo `json:"index_info"` - ForeignKeys []*FKInfo `json:"fk_info"` - State SchemaState `json:"state"` - PKIsHandle bool `json:"pk_is_handle"` - Comment string `json:"comment"` - AutoIncID int64 `json:"auto_inc_id"` - AutoIncCache int64 `json:"auto_inc_cache"` - MaxColumnID int64 `json:"max_col_id"` - MaxIndexID int64 `json:"max_idx_id"` + Columns []*ColumnInfo `json:"cols"` + Indices []*IndexInfo `json:"index_info"` + ForeignKeys []*FKInfo `json:"fk_info"` + State SchemaState `json:"state"` + PKIsHandle bool `json:"pk_is_handle"` + Comment string `json:"comment"` + AutoIncID int64 `json:"auto_inc_id"` + AutoIdCache int64 `json:"auto_id_cache"` + 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"` diff --git a/parser_test.go b/parser_test.go index f5ab8950a..aa4fff23d 100644 --- a/parser_test.go +++ b/parser_test.go @@ -2917,7 +2917,7 @@ func (s *testParserSuite) TestDDL(c *C) { {"create table t (a bigint primary key auto_random(4), b varchar(255))", true, "CREATE TABLE `t` (`a` BIGINT PRIMARY KEY AUTO_RANDOM(4),`b` VARCHAR(255))"}, {"create table t (a bigint primary key auto_random(3) primary key unique, b varchar(255))", true, "CREATE TABLE `t` (`a` BIGINT PRIMARY KEY AUTO_RANDOM(3) PRIMARY KEY UNIQUE KEY,`b` VARCHAR(255))"}, - // for auto_increment_cache + // for auto_id_cache {"create table t (a int) auto_id_cache=1", true, "CREATE TABLE `t` (`a` INT) AUTO_ID_CACHE = 1"}, {"create table t (a int auto_increment key) auto_id_cache 10", true, "CREATE TABLE `t` (`a` INT AUTO_INCREMENT PRIMARY KEY) AUTO_ID_CACHE = 10"}, {"create table t (a bigint, b varchar(255)) auto_id_cache 50", true, "CREATE TABLE `t` (`a` BIGINT,`b` VARCHAR(255)) AUTO_ID_CACHE = 50"},