Skip to content

Commit

Permalink
executor: fix admin show ddl jobs end time bug when job is not finish…
Browse files Browse the repository at this point in the history
…ed (#14738)
  • Loading branch information
crazycs520 authored Feb 12, 2020
1 parent 77c7875 commit be434ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,11 @@ func (e *ShowDDLJobsExec) appendJobToChunk(req *chunk.Chunk, job *model.Job) {
req.AppendInt64(6, job.TableID)
req.AppendInt64(7, job.RowCount)
req.AppendString(8, model.TSConvert2Time(job.StartTS).String())
req.AppendString(9, model.TSConvert2Time(finishTS).String())
if finishTS > 0 {
req.AppendString(9, model.TSConvert2Time(finishTS).String())
} else {
req.AppendString(9, "")
}
req.AppendString(10, job.State.String())
}

Expand Down
1 change: 1 addition & 0 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ func (s *testSuiteP2) TestAdminShowDDLJobs(c *C) {
re = tk.MustQuery("admin show ddl jobs 1 where job_type='create table'")
row = re.Rows()[0]
c.Assert(row[1], Equals, "test_admin_show_ddl_jobs")
c.Assert(row[9], Equals, "")
}

func (s *testSuiteP2) TestAdminChecksumOfPartitionedTable(c *C) {
Expand Down

0 comments on commit be434ba

Please sign in to comment.