Skip to content

Commit

Permalink
Merge remote-tracking branch 'apache/master' into rename-module3
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyuecai committed Mar 16, 2024
2 parents 5d36fb7 + 72ca442 commit 7e76415
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/datasource/sql/conn_xa.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ func (c *XAConn) ExecContext(ctx context.Context, query string, args []driver.Na
return types.NewResult(types.WithResult(ret)), nil
})

return ret.GetResult(), err
if err != nil {
return nil, err
}

return ret.GetResult(), nil
}

// BeginTx like common transaction. but it just exec XA START
Expand Down Expand Up @@ -257,11 +261,11 @@ func (c *XAConn) start(ctx context.Context) error {
}

func (c *XAConn) end(ctx context.Context, flags int) error {
err := c.termination(c.xaBranchXid.String())
err := c.xaResource.End(ctx, c.xaBranchXid.String(), flags)
if err != nil {
return err
}
err = c.xaResource.End(ctx, c.xaBranchXid.String(), flags)
err = c.termination(c.xaBranchXid.String())
if err != nil {
return err
}
Expand Down

0 comments on commit 7e76415

Please sign in to comment.