Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidb, variable: refactor retry, add TransactionContext #2256

Merged
merged 5 commits into from
Dec 16, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
*: address comment
  • Loading branch information
coocood committed Dec 15, 2016
commit 923e5eef871285a81e93001bdb78a7faba558717
12 changes: 6 additions & 6 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ func (s *session) CommitTxn() error {
}

func (s *session) RollbackTxn() error {
var err error
if s.txn != nil {
s.cleanRetryInfo()
err = s.txn.Rollback()
s.txn = nil
s.sessionVars.SetStatusFlag(mysql.ServerStatusInTrans, false)
if s.txn == nil {
return nil
}
s.cleanRetryInfo()
err := s.txn.Rollback()
s.txn = nil
s.sessionVars.SetStatusFlag(mysql.ServerStatusInTrans, false)
return errors.Trace(err)
}

Expand Down