mirror of https://github.com/jackc/pgx.git
Return proper error in Tx.CopyFrom when tx has failed
parent
7181a0b52c
commit
e096a14b3e
3
tx.go
3
tx.go
|
@ -241,6 +241,9 @@ func (tx *Tx) QueryRowEx(ctx context.Context, sql string, options *QueryExOption
|
|||
|
||||
// CopyFrom delegates to the underlying *Conn
|
||||
func (tx *Tx) CopyFrom(tableName Identifier, columnNames []string, rowSrc CopyFromSource) (int, error) {
|
||||
if tx.Status() == TxStatusInFailure {
|
||||
return 0, ErrTxInFailure
|
||||
}
|
||||
if tx.Status() != TxStatusInProgress {
|
||||
return 0, ErrTxClosed
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue