diff --git a/lib/result.js b/lib/result.js index 7dfd116f0..744983b96 100644 --- a/lib/result.js +++ b/lib/result.js @@ -22,6 +22,7 @@ var Result = function (rowMode) { this._parsers = [] this.RowCtor = null this.rowAsArray = rowMode === 'array' + this.cmdStatus = null; if (this.rowAsArray) { this.parseRow = this._parseRowAsArray } @@ -29,12 +30,13 @@ var Result = function (rowMode) { var matchRegexp = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/ -// adds a command complete message -Result.prototype.addCommandComplete = function (msg) { - var match - if (msg.text) { - // pure javascript - match = matchRegexp.exec(msg.text) +//adds a command complete message +Result.prototype.addCommandComplete = function(msg) { + this.cmdStatus = msg.text; + var match; + if(msg.text) { + //pure javascript + match = matchRegexp.exec(msg.text); } else { // native bindings match = matchRegexp.exec(msg.command) @@ -52,15 +54,11 @@ Result.prototype.addCommandComplete = function (msg) { } } -Result.prototype._parseRowAsArray = function (rowData) { - var row = [] - for (var i = 0, len = rowData.length; i < len; i++) { - var rawValue = rowData[i] - if (rawValue !== null) { - row.push(this._parsers[i](rawValue)) - } else { - row.push(null) - } +Result.prototype._parseRowAsArray = function(rowData) { + var row = []; + for(var i = 0, len = rowData.length; i < len; i++) { + var rawValue = rowData[i]; + row.push(rawValue); } return row }