Skip to content

Commit

Permalink
ddl/model: fix ddl log format (pingcap#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf authored and coocood committed Feb 7, 2017
1 parent 6f8fc91 commit 76bf890
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (d *ddl) doDDLJob(ctx context.Context, job *model.Job) error {

// Notice worker that we push a new job and wait the job done.
asyncNotify(d.ddlJobCh)
log.Infof("[ddl] start DDL job %s", job)
log.Infof("[ddl] start DDL job %s, Query:\n%s", job, job.Query)

var historyJob *model.Job
jobID := job.ID
Expand Down
4 changes: 2 additions & 2 deletions model/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func (job *Job) DecodeArgs(args ...interface{}) error {
// String implements fmt.Stringer interface.
func (job *Job) String() string {
rowCount := job.GetRowCount()
return fmt.Sprintf("ID:%d, Type:%s, State:%s, SchemaState:%s, SchemaID:%d, TableID:%d, RowCount:%d, ArgLen:%d, Query:\n%s",
job.ID, job.Type, job.State, job.SchemaState, job.SchemaID, job.TableID, rowCount, len(job.Args), job.Query)
return fmt.Sprintf("ID:%d, Type:%s, State:%s, SchemaState:%s, SchemaID:%d, TableID:%d, RowCount:%d, ArgLen:%d",
job.ID, job.Type, job.State, job.SchemaState, job.SchemaID, job.TableID, rowCount, len(job.Args))
}

// IsFinished returns whether job is finished or not.
Expand Down

0 comments on commit 76bf890

Please sign in to comment.