Skip to content

Commit

Permalink
test: fix integration-ddl-test (#35014)
Browse files Browse the repository at this point in the history
close #35020
  • Loading branch information
xiongjiwei authored May 30, 2022
1 parent b598bd2 commit dbce66a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,10 @@ func GetHistoryJobByID(sess sessionctx.Context, id int64) (*model.Job, error) {
if err != nil {
return nil, err
}
defer func() {
// we can ignore the commit error because this txn is readonly.
_ = sess.CommitTxn(context.Background())
}()
txn, err := sess.Txn(true)
if err != nil {
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4431,6 +4431,8 @@ func TestAdminShowDDLJobs(t *testing.T) {
// See PR: 11561.
job.BinlogInfo = nil
job.SchemaName = ""
err = sessiontxn.NewTxnInStmt(context.Background(), tk.Session())
require.NoError(t, err)
txn, err := tk.Session().Txn(true)
require.NoError(t, err)
err = ddl.AddHistoryDDLJob(meta.NewMeta(txn), job, true)
Expand Down

0 comments on commit dbce66a

Please sign in to comment.