You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I call func (tx *mysqlTx) Commit() (err error) ,if connection has problem it return an ErrInvalidConn
but if current connection is fine it call exec
and in exec it call readResultSetHeaderPacket after the transaction sent to db successfully, and readResultSetHeaderPacket call readPacket() and it also may lead to ErrInvalidConn
thus I can't distinguish whether the transaction has been sent, it lead to one transaction sent twice and data not correct. Is it possible to add a new error to distinguish this two cases?
Issue description
when I call func (tx *mysqlTx) Commit() (err error) ,if connection has problem it return an ErrInvalidConn
but if current connection is fine it call exec
and in exec it call readResultSetHeaderPacket after the transaction sent to db successfully, and readResultSetHeaderPacket call readPacket() and it also may lead to ErrInvalidConn
thus I can't distinguish whether the transaction has been sent, it lead to one transaction sent twice and data not correct. Is it possible to add a new error to distinguish this two cases?
Example code
err = tx.Commit(ctx)
if err != nil {
xlog.Errorf(ctx, "%s commit transaction failed, table:%v err:%v", fun, table, err) ...
Error log
Configuration
Driver version (or git SHA):
*Go version: go1.12 linux/amd64
*Server version: tidb
*Server OS: redhat7.2
The text was updated successfully, but these errors were encountered: