Skip to content

Driver fails and ditches connection when rolling back a transaction. #454

@ghost

Description

The error produced are a large number of

    [mysql] 2016/05/11 22:54:10 packets.go:426: busy buffer

one for each stored procedure promoted to the transaction with Tx.Stmt().

Here is the corresponding stack trace:

[1] github.com/go-sql-driver/mysql.(_mysqlConn).writeCommandPacketUint32@0x00000000005F7795 at /home/dtrombley/go/src/github.com/go-sql-driver/mysql/packets.go:427
[2] github.com/go-sql-driver/mysql.(_mysqlStmt).Close@0x00000000005FFD87 at /home/dtrombley/go/src/github.com/go-sql-driver/mysql/statement.go:31
[3] database/sql.(_driverConn).finalClose@0x0000000000496024 at /home/dtrombley/golang/go1.6/src/database/sql/sql.go:355
[4] database/sql.(finalCloser).(database/sql.finalClose)-fm@0x00000000004A16D0 at /home/dtrombley/golang/go1.6/src/database/sql/sql.go:449
[5] database/sql.(_driverConn).Close@0x0000000000495ECB at /home/dtrombley/golang/go1.6/src/database/sql/sql.go:349
[6] database/sql.(_DB).putConn@0x0000000000499811 at /home/dtrombley/golang/go1.6/src/database/sql/sql.go:900
[7] database/sql.(_Tx).close@0x000000000049BF4D at /home/dtrombley/golang/go1.6/src/database/sql/sql.go:1225
[8] database/sql.(*Tx).Rollback@0x000000000049C384 at /home/dtrombley/golang/go1.6/src/database/sql/sql.go:1273

To my thinking there is no reason something so low-level should be going wrong like this with any pattern of driver calls.

All I've done is prepare some sql.Stmt with sql.DB.Prepare(), promote them to transaction statements (the necessity to do this is in itself appalling, but that's how you get statements in SPs with Go database/sql - it recompiles them every time) with sql.Tx.Stmt(), execute them with sql.Stmt.Query(), close the resulting rowset with Rows.Close(), then rollback the transaction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions