Skip to content

Commit a8437ac

Browse files
committed
just changes the query string.
1 parent 8e75469 commit a8437ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

connection.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ func (mc *mysqlConn) begin(readOnly bool) (driver.Tx, error) {
9090
errLog.Print(ErrInvalidConn)
9191
return nil, driver.ErrBadConn
9292
}
93-
var err error
93+
var q string
9494
if readOnly {
95-
err = mc.exec("START TRANSACTION READ ONLY")
95+
q = "START TRANSACTION READ ONLY"
9696
} else {
97-
err = mc.exec("START TRANSACTION")
97+
q = "START TRANSACTION"
9898
}
99+
err := mc.exec(q)
99100
if err == nil {
100101
return &mysqlTx{mc}, err
101102
}

0 commit comments

Comments
 (0)