Skip to content

Commit

Permalink
roachpb: clone Transaction in Error.UpdateTxn
Browse files Browse the repository at this point in the history
I'm not aware of this causing issues, but we're pretty careful with this
in other places (like BatchResponse_Header.combine) to avoid issues like
what we saw in cockroachdb#34241, so this seems like a good change.

Release note: None
  • Loading branch information
nvanbenschoten committed Jun 8, 2019
1 parent 9582afc commit fde56ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/roachpb/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (e *Error) UpdateTxn(o *Transaction) {
return
}
if e.UnexposedTxn == nil {
e.UnexposedTxn = o
e.UnexposedTxn = o.Clone()
} else {
e.UnexposedTxn.Update(o)
}
Expand Down

0 comments on commit fde56ac

Please sign in to comment.