Update tx status on ready for query message

This commit is contained in:
Jack Christensen 2013-07-13 09:04:38 -04:00
parent b4e96027b3
commit e162a0bbcb

View File

@ -99,6 +99,7 @@ func Connect(parameters ConnectionParameters) (c *Connection, err error) {
return nil, err return nil, err
} }
case readyForQuery: case readyForQuery:
c.rxReadyForQuery(r)
return c, nil return c, nil
default: default:
if err = c.processContextFreeMsg(t, r); err != nil { if err = c.processContextFreeMsg(t, r); err != nil {
@ -132,6 +133,7 @@ func (c *Connection) SelectFunc(sql string, onDataRow func(*DataRowReader) error
if t, r, rxErr := c.rxMsg(); rxErr == nil { if t, r, rxErr := c.rxMsg(); rxErr == nil {
switch t { switch t {
case readyForQuery: case readyForQuery:
c.rxReadyForQuery(r)
return return
case rowDescription: case rowDescription:
fields = c.rxRowDescription(r) fields = c.rxRowDescription(r)
@ -268,6 +270,7 @@ func (c *Connection) Prepare(name, sql string) (err error) {
} }
} }
case readyForQuery: case readyForQuery:
c.rxReadyForQuery(r)
c.preparedStatements[name] = &ps c.preparedStatements[name] = &ps
return return
default: default:
@ -394,6 +397,7 @@ func (c *Connection) Execute(sql string, arguments ...interface{}) (commandTag s
if t, r, rxErr := c.rxMsg(); rxErr == nil { if t, r, rxErr := c.rxMsg(); rxErr == nil {
switch t { switch t {
case readyForQuery: case readyForQuery:
c.rxReadyForQuery(r)
return return
case rowDescription: case rowDescription:
case dataRow: case dataRow: