Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao committed Apr 27, 2021
2 parents afcf229 + 4a1fff1 commit 8ab637c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions model/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
12 changes: 6 additions & 6 deletions model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -69,7 +69,7 @@ func (s SchemaState) String() string {
case StateGlobalTxnOnly:
return "global txn only"
default:
return "none"
return "queueing"
}
}

Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion model/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:<nil>, 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:<nil>, ErrCount:0, SnapshotVersion:0", t))
}

func (*testModelSuite) TestJobCodec(c *C) {
Expand Down

0 comments on commit 8ab637c

Please sign in to comment.