diff --git a/model/ddl.go b/model/ddl.go index 5b596c12a..916ff810d 100644 --- a/model/ddl.go +++ b/model/ddl.go @@ -215,6 +215,9 @@ type Job struct { SchemaState SchemaState `json:"schema_state"` // SnapshotVer means snapshot version for this job. SnapshotVer uint64 `json:"snapshot_ver"` + // RealStartTS uses timestamp allocated by TSO. + // Now it's the TS when we actually start the job. + RealStartTS uint64 `json:"real_start_ts"` // StartTS uses timestamp allocated by TSO. // Now it's the TS when we put the job to TiKV queue. StartTS uint64 `json:"start_ts"` diff --git a/model/model.go b/model/model.go index 6fbde0c03..962a38690 100644 --- a/model/model.go +++ b/model/model.go @@ -42,7 +42,7 @@ const ( StateDeleteReorganization // StatePublic means this schema element is ok for all write and read operations. StatePublic - // StateReplica means we're waiting tiflash replica to be finished. + // StateReplicaOnly means we're waiting tiflash replica to be finished. StateReplicaOnly // StateGlobalTxnOnly means we can only use global txn for operator on this schema element StateGlobalTxnOnly @@ -69,7 +69,7 @@ func (s SchemaState) String() string { case StateGlobalTxnOnly: return "global txn only" default: - return "none" + return "queueing" } } @@ -134,7 +134,7 @@ func (c *ColumnInfo) IsGenerated() bool { return len(c.GeneratedExprString) != 0 } -// SetOriginalDefaultValue sets the origin default value. +// SetOriginDefaultValue sets the origin default value. // For mysql.TypeBit type, the default value storage format must be a string. // Other value such as int must convert to string format first. // The mysql.TypeBit type supports the null default value. @@ -153,7 +153,7 @@ func (c *ColumnInfo) SetOriginDefaultValue(value interface{}) error { return nil } -// GetOriginalDefaultValue gets the origin default value. +// GetOriginDefaultValue gets the origin default value. func (c *ColumnInfo) GetOriginDefaultValue() interface{} { if c.Tp == mysql.TypeBit && c.OriginDefaultValueBit != nil { // If the column type is BIT, both `OriginDefaultValue` and `DefaultValue` of ColumnInfo are corrupted, @@ -220,7 +220,7 @@ func FindColumnInfo(cols []*ColumnInfo, name string) *ColumnInfo { // for use of execution phase. const ExtraHandleID = -1 -// ExtraPartitionID is the column ID of column which store the partitionID decoded in global index values. +// ExtraPidColID is the column ID of column which store the partitionID decoded in global index values. const ExtraPidColID = -2 const ( @@ -642,7 +642,7 @@ func (t *TableInfo) IsBaseTable() bool { return t.Sequence == nil && t.View == nil } -// ViewAlgorithm is VIEW's SQL AlGORITHM characteristic. +// ViewAlgorithm is VIEW's SQL ALGORITHM characteristic. // See https://dev.mysql.com/doc/refman/5.7/en/view-algorithms.html type ViewAlgorithm int diff --git a/model/model_test.go b/model/model_test.go index 870d5f49a..4d00983aa 100644 --- a/model/model_test.go +++ b/model/model_test.go @@ -152,7 +152,7 @@ func (*testModelSuite) TestJobStartTime(c *C) { } t := time.Unix(0, 0) c.Assert(t, Equals, TSConvert2Time(job.StartTS)) - c.Assert(job.String(), Equals, fmt.Sprintf("ID:123, Type:none, State:none, SchemaState:none, SchemaID:0, TableID:0, RowCount:0, ArgLen:0, start time: %s, Err:, ErrCount:0, SnapshotVersion:0", t)) + c.Assert(job.String(), Equals, fmt.Sprintf("ID:123, Type:none, State:none, SchemaState:queueing, SchemaID:0, TableID:0, RowCount:0, ArgLen:0, start time: %s, Err:, ErrCount:0, SnapshotVersion:0", t)) } func (*testModelSuite) TestJobCodec(c *C) {