diff --git a/lib/Client.js b/lib/Client.js index 7b5979b..c36ce76 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -284,8 +284,7 @@ Client.prototype.lastInsertId = function() { }; Client.prototype.escape = function(str) { - this._initHandle(); - return this._handle.escape(str); + return addon.escape(str); }; Client.prototype.serverVersion = function() { @@ -607,10 +606,13 @@ Client.prototype._processQueue = function(ignoreConnected) { this._tmrInactive = undefined; req = this._req = queue[0]; - this._handle.query(req.str, - req.needColumns, - req.needMetadata, - req.cb !== undefined); + var self = this; + process.nextTick(function() { + self._handle.query(req.str, + req.needColumns, + req.needMetadata, + req.cb !== undefined); + }); } else if (connected) { if (this.closing && !this._handleClosing) { this._handleClosing = true;