Skip to content

Commit

Permalink
cherry pick pingcap#18952 to release-4.0
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
coocood authored and ti-srebot committed Sep 4, 2020
1 parent 709b48a commit db88db9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ func (s *session) PrepareTxnCtx(ctx context.Context) {
SchemaVersion: is.SchemaMetaVersion(),
CreateTime: time.Now(),
}
if !s.sessionVars.IsAutocommit() {
if !s.sessionVars.IsAutocommit() || s.sessionVars.RetryInfo.Retrying {
pessTxnConf := config.GetGlobalConfig().PessimisticTxn
if pessTxnConf.Enable {
if s.sessionVars.TxnMode == ast.Pessimistic {
Expand Down

0 comments on commit db88db9

Please sign in to comment.