Proper fix for #510 and related

This commit is contained in:
Tim Griesser 2014-10-01 18:28:30 -04:00
parent 2abc48d73b
commit 239f906450

View File

@ -101,10 +101,10 @@ Client_MySQL.prototype.acquireRawConnection = function() {
var client = this;
var connection = mysql.createConnection(this.connectionSettings);
return new Promise(function(resolver, rejecter) {
connection.on('error', connectionErrorHandler.bind(null, client, connection));
connection.on('end', connectionErrorHandler.bind(null, client, connection));
connection.connect(function(err) {
if (err) return rejecter(err);
connection.on('error', connectionErrorHandler.bind(null, client, connection));
connection.on('end', connectionErrorHandler.bind(null, client, connection));
resolver(connection);
});
});