Skip to content

Commit f55d879

Browse files
committed
Apply fix
1 parent 17e7e9e commit f55d879

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/pg/lib/query.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class Query extends EventEmitter {
142142
// the docs here: https://www.postgresql.org/docs/9.6/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
143143
// say "Therefore, an Execute phase is always terminated by the appearance of exactly one of these messages: CommandComplete, EmptyQueryResponse (if the portal was created from an empty query string), ErrorResponse, or PortalSuspended."
144144
maybeSync(connection) {
145-
if (this.isPreparedStatement) {
145+
if (this.isPreparedStatement && !this._hasSentSync) {
146146
this._hasSentSync = true
147147
connection.sync()
148148
}

packages/pg/test/integration/gh-issues/1105-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ suite.testAsync('timeout causing query crashes', async () => {
66
const client = new helper.Client()
77
await client.connect()
88
await client.query('CREATE TEMP TABLE foobar( name TEXT NOT NULL, id SERIAL)')
9-
client.query('BEGIN')
9+
await client.query('BEGIN')
1010
await client.query("SET LOCAL statement_timeout TO '1ms'")
1111
let count = 0
1212
while (count++ < 5000) {

0 commit comments

Comments
 (0)