MCPcopy
hub / github.com/go-sql-driver/mysql / Commit

Method Commit

transaction.go:15–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15func (tx *mysqlTx) Commit() (err error) {
16 if tx.mc == nil {
17 return ErrInvalidConn
18 }
19 if tx.mc.closed.Load() {
20 err = tx.mc.error()
21 if err == nil {
22 err = ErrInvalidConn
23 }
24 return
25 }
26 err = tx.mc.exec("COMMIT")
27 tx.mc = nil
28 return
29}
30
31func (tx *mysqlTx) Rollback() (err error) {
32 if tx.mc == nil {

Callers 4

TestConcurrentFunction · 0.80
TestContextCancelBeginFunction · 0.80
TestContextBeginReadOnlyFunction · 0.80

Calls 2

errorMethod · 0.80
execMethod · 0.80

Tested by 4

TestConcurrentFunction · 0.64
TestContextCancelBeginFunction · 0.64
TestContextBeginReadOnlyFunction · 0.64