MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / pushConn

Method pushConn

IceFireDB-SQLProxy/internal/mysql/proxy.go:171–192  ·  view source on GitHub ↗
(mysqlConn *client.Conn, err error, pool *client.Pool)

Source from the content-addressed store, hash-verified

169}
170
171func (m *mysqlProxy) pushConn(mysqlConn *client.Conn, err error, pool *client.Pool) {
172 if errors.Is(err, mysql.ErrBadConn) {
173 mysqlConn.Close()
174 return
175 }
176 if mysqlConn.IsInTransaction() {
177 return
178 }
179 if err != nil {
180 if err := mysqlConn.Rollback(); err != nil {
181 mysqlConn.Close()
182 return
183 }
184 }
185 if mysqlConn.IOErr() != nil {
186 mysqlConn.Close()
187 return
188 }
189 if mysqlConn.Conn != nil {
190 pool.PutConn(mysqlConn)
191 }
192}

Callers 2

pushAdminConnMethod · 0.95
pushReadonlyConnMethod · 0.95

Calls 5

CloseMethod · 0.65
IsInTransactionMethod · 0.45
RollbackMethod · 0.45
IOErrMethod · 0.45
PutConnMethod · 0.45

Tested by

no test coverage detected