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

Method SetAutoCommit

IceFireDB-SQLProxy/pkg/mysql/client/conn.go:270–281  ·  view source on GitHub ↗
(n bool)

Source from the content-addressed store, hash-verified

268}
269
270func (c *Conn) SetAutoCommit(n bool) error {
271 if n && !c.IsAutoCommit() {
272 if _, err := c.exec("SET AUTOCOMMIT = 1"); err != nil {
273 return errors.Trace(err)
274 }
275 } else if c.IsAutoCommit() {
276 if _, err := c.exec("SET AUTOCOMMIT = 0"); err != nil {
277 return errors.Trace(err)
278 }
279 }
280 return nil
281}
282
283func (c *Conn) IsAutoCommit() bool {
284 return c.status&SERVER_STATUS_AUTOCOMMIT > 0

Callers 1

popConnMethod · 0.95

Calls 2

IsAutoCommitMethod · 0.95
execMethod · 0.95

Tested by

no test coverage detected