Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/pg/lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class Client extends EventEmitter {
this.secretKey = msg.secretKey
}

_handleReadyForQuery(msg) {
_handleReadyForQuery() {
if (this._connecting) {
this._connecting = false
this._connected = true
Expand All @@ -318,7 +318,7 @@ class Client extends EventEmitter {
this.activeQuery = null
this.readyForQuery = true
if (activeQuery) {
activeQuery.handleReadyForQuery(this.connection)
activeQuery.handleReadyForQuery()
}
this._pulseQueryQueue()
}
Expand Down
9 changes: 4 additions & 5 deletions packages/pg/lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ class Query extends EventEmitter {
}

handleDataRow(msg) {
let row

if (this._canceledDueToError) {
return
}

let row
try {
row = this._result.parseRow(msg.fields)
} catch (err) {
Expand Down Expand Up @@ -119,7 +118,7 @@ class Query extends EventEmitter {
}
}

handleError(err, connection) {
handleError(err) {
// need to sync after error during a prepared statement
if (this._canceledDueToError) {
err = this._canceledDueToError
Expand All @@ -133,9 +132,9 @@ class Query extends EventEmitter {
this.emit('error', err)
}

handleReadyForQuery(con) {
handleReadyForQuery() {
if (this._canceledDueToError) {
return this.handleError(this._canceledDueToError, con)
return this.handleError(this._canceledDueToError)
}
if (this.callback) {
try {
Expand Down
4 changes: 0 additions & 4 deletions packages/pg/lib/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ class Result {
var rawValue = rowData[i]
if (rawValue !== null) {
row[i] = this._parsers[i](rawValue)
} else {
row[i] = null
}
}
return row
Expand All @@ -67,8 +65,6 @@ class Result {
var field = this.fields[i].name
if (rawValue !== null) {
row[field] = this._parsers[i](rawValue)
} else {
row[field] = null
}
}
return row
Expand Down
Loading