Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zhouit
Copy link
Contributor

@zhouit zhouit commented May 31, 2023

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

fix begin transaction fail, rollback panic

User Case Description

tx = db.Begin()  // when begin error

err := tx.Where(sql).Update(m).Err
if err = nil{
  tx.Rollback()   // will panic
  return err
}

tx.Commit()

@jinzhu jinzhu merged commit 740f2be into go-gorm:master May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants