Skip to content

Commit

Permalink
Pass db error to new instance
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Apr 9, 2021
1 parent f3bdfa8 commit ad53074
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (db *DB) DB() (*sql.DB, error) {

func (db *DB) getInstance() *DB {
if db.clone > 0 {
tx := &DB{Config: db.Config}
tx := &DB{Config: db.Config, Error: db.Error}

if db.clone == 1 {
// clone with new statement
Expand Down

0 comments on commit ad53074

Please sign in to comment.