File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ Asta Xie <xiemengjun at gmail.com>
2525B Lamarche <blam413 at gmail.com>
2626Bes Dollma <bdollma@thousandeyes.com>
2727Bogdan Constantinescu <bog.con.bc at gmail.com>
28+ Brad Higgins <brad at defined.net>
2829Brian Hendriks <brian at dolthub.com>
2930Bulat Gaifullin <gaifullinbf at gmail.com>
3031Caine Jette <jette at alum.mit.edu>
@@ -135,6 +136,7 @@ Ziheng Lyu <zihenglv at gmail.com>
135136
136137Barracuda Networks, Inc.
137138Counting Ltd.
139+ Defined Networking Inc.
138140DigitalOcean Inc.
139141Dolthub Inc.
140142dyves labs AG
Original file line number Diff line number Diff line change @@ -13,18 +13,32 @@ type mysqlTx struct {
1313}
1414
1515func (tx * mysqlTx ) Commit () (err error ) {
16- if tx .mc == nil || tx . mc . closed . Load () {
16+ if tx .mc == nil {
1717 return ErrInvalidConn
1818 }
19+ if tx .mc .closed .Load () {
20+ err = tx .mc .error ()
21+ if err == nil {
22+ err = ErrInvalidConn
23+ }
24+ return
25+ }
1926 err = tx .mc .exec ("COMMIT" )
2027 tx .mc = nil
2128 return
2229}
2330
2431func (tx * mysqlTx ) Rollback () (err error ) {
25- if tx .mc == nil || tx . mc . closed . Load () {
32+ if tx .mc == nil {
2633 return ErrInvalidConn
2734 }
35+ if tx .mc .closed .Load () {
36+ err = tx .mc .error ()
37+ if err == nil {
38+ err = ErrInvalidConn
39+ }
40+ return
41+ }
2842 err = tx .mc .exec ("ROLLBACK" )
2943 tx .mc = nil
3044 return
You can’t perform that action at this time.
0 commit comments