fix: ignore if not prepare stmt
This commit is contained in:
parent
484d162023
commit
07d355c82d
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ _book
|
||||
.idea
|
||||
vendor
|
||||
.vscode
|
||||
.DS_Store
|
||||
|
@ -617,7 +617,9 @@ func (db *DB) Transaction(fc func(tx *DB) error, opts ...*sql.TxOptions) (err er
|
||||
|
||||
if committer, ok := db.Statement.ConnPool.(TxCommitter); ok && committer != nil {
|
||||
// nested transaction
|
||||
if !db.DisableNestedTransaction && (db.PrepareStmt && !db.DisablePrepareNestedTransaction) {
|
||||
if !db.DisableNestedTransaction && (!db.PrepareStmt ||
|
||||
(db.PrepareStmt && !db.DisablePrepareNestedTransaction)) {
|
||||
|
||||
err = db.SavePoint(fmt.Sprintf("sp%p", fc)).Error
|
||||
if err != nil {
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user