fix: use preparestmt in trasaction will use new conn

This commit is contained in:
kinggo 2022-07-13 13:55:32 +08:00
parent 62fdc2bb3b
commit 8ad4bc44d3

View File

@ -249,7 +249,7 @@ func (db *DB) Session(config *Session) *DB {
if v, ok := db.cacheStore.Load(preparedStmtDBKey); ok {
preparedStmt := v.(*PreparedStmtDB)
tx.Statement.ConnPool = &PreparedStmtDB{
ConnPool: db.Config.ConnPool,
ConnPool: db.Statement.ConnPool,
Mux: preparedStmt.Mux,
Stmts: preparedStmt.Stmts,
}