diff --git a/executor/executor.go b/executor/executor.go index 617e294fcad93..0fcee0117a9f0 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -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()) } diff --git a/executor/executor_test.go b/executor/executor_test.go index 8ec6bd912e33a..4040bc9b9c89f 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -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) {