add support for queries that don't return a row description

This commit is contained in:
Stephen Sugden 2014-05-21 22:44:51 +02:00
parent 5084624e8d
commit 8283fd9b22

View File

@ -32,14 +32,28 @@ Cursor.prototype.submit = function(connection) {
}, true)
con.flush()
con.once('noData', ifNoData)
con.once('rowDescription', function () {
con.removeListener('noData', ifNoData);
});
function ifNoData () {
self.state = 'idle'
self._shiftQueue();
}
}
Cursor.prototype._shiftQueue = function () {
if(this._queue.length) {
this._getRows.apply(this, this._queue.shift())
}
}
Cursor.prototype.handleRowDescription = function(msg) {
this._result.addFields(msg.fields)
this.state = 'idle'
if(this._queue.length) {
this._getRows.apply(this, this._queue.shift())
}
this._shiftQueue();
}
Cursor.prototype.handleDataRow = function(msg) {