Comparing version 1.0.0-rc.10 to 1.0.0-rc.11
@@ -0,1 +1,9 @@ | ||
1.0.0-rc-11 ( 14/08/2016 ) | ||
- pool: support namedPlaceholder flag in `pool.query` | ||
and `pool.execute` helpers #369 | ||
- pool: do not emit error on query command if callback #372 | ||
was passed | ||
- pool: propagate connection time error back | ||
to .getConnection() #372 | ||
1.0.0-rc-10 ( 09/08/2016 ) | ||
@@ -2,0 +10,0 @@ - ssl: do not use deprecated tls.createSecurePair |
@@ -78,2 +78,3 @@ var util = require('util'); | ||
this.on('error', function (e) { | ||
connection._fatalError = e; | ||
connection._protocolError = e; | ||
@@ -80,0 +81,0 @@ }); |
@@ -111,2 +111,5 @@ var net = require('net'); | ||
}); | ||
handshakeCommand.on('error', function(err) { | ||
connection._notifyError(err); | ||
}); | ||
this.addCommand(handshakeCommand); | ||
@@ -113,0 +116,0 @@ } |
@@ -16,4 +16,9 @@ var mysql = require('../index.js'); | ||
// and we will be notified of disconnects. | ||
this.on('end', this._removeFromPool); | ||
this.on('error', this._removeFromPool); | ||
var connection = this; | ||
this.on('end', function(err) { | ||
this._removeFromPool(); | ||
}); | ||
this.on('error', function(err) { | ||
this._removeFromPool(); | ||
}); | ||
} | ||
@@ -42,7 +47,7 @@ | ||
PoolConnection.prototype.destroy = function () { | ||
this._removeFromPool(this); | ||
this._removeFromPool(); | ||
return Connection.prototype.destroy.apply(this, arguments); | ||
}; | ||
PoolConnection.prototype._removeFromPool = function (connection) { | ||
PoolConnection.prototype._removeFromPool = function () { | ||
if (!this._pool || this._pool._closed) { | ||
@@ -49,0 +54,0 @@ return; |
@@ -129,9 +129,10 @@ var mysql = require('../index.js'); | ||
var cmdQuery = Connection.createQuery(sql, values, cb, this.config.connectionConfig); | ||
cmdQuery.namedPlaceholders = this.config.namedPlaceholders; | ||
cmdQuery.namedPlaceholders = this.config.connectionConfig.namedPlaceholders; | ||
this.getConnection(function (err, conn) { | ||
if (err) { | ||
cmdQuery.emit('error', err); | ||
if (typeof cmdQuery.onResult === 'function') { | ||
cmdQuery.onResult(err); | ||
} else { | ||
cmdQuery.emit('error', err); | ||
} | ||
@@ -149,9 +150,4 @@ return; | ||
Pool.prototype.execute = function (sql, values, cb) { | ||
if (typeof values === 'function') { | ||
cb = values; | ||
values = null; | ||
} | ||
var useNamedPlaceholders = this.config.connectionConfig.namedPlaceholders; | ||
var useNamedPlaceholders = this.config.namedPlaceholders; | ||
this.getConnection(function (err, conn) { | ||
@@ -158,0 +154,0 @@ if (err) { |
{ | ||
"name": "mysql2", | ||
"version": "1.0.0-rc.10", | ||
"version": "1.0.0-rc.11", | ||
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
296166
7238