mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
bugfix: correctly create new connection for canceling copy to query
This commit is contained in:
parent
c5c31143c1
commit
8ea2f259ed
@ -111,7 +111,9 @@ p.connect = function(callback) {
|
||||
con.on('copyOutResponse', function(msg) {
|
||||
if (self.activeQuery.stream === undefined) {
|
||||
self.activeQuery._canceledDueToError = new Error('No destination stream defined');
|
||||
(new self.constructor(self.config)).cancel(self, self.activeQuery);
|
||||
//canceling query requires creation of new connection
|
||||
//look for postgres frontend/backend protocol
|
||||
(new self.constructor({port: self.port, host: self.host})).cancel(self, self.activeQuery);
|
||||
}
|
||||
});
|
||||
con.on('copyData', function (msg) {
|
||||
|
||||
@ -203,7 +203,7 @@ var clientBuilder = function(config) {
|
||||
connection.on('copyOutResponse', function(msg) {
|
||||
if (connection._activeQuery.stream === undefined) {
|
||||
connection._activeQuery._canceledDueToError = new Error('No destination stream defined');
|
||||
(new clientBuilder(connection.config)).cancel(connection, connection._activeQuery);
|
||||
(new clientBuilder({port: connection.port, host: connection.host})).cancel(connection, connection._activeQuery);
|
||||
}
|
||||
});
|
||||
connection.on('copyData', function (chunk) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user