No announcement yet.

Issue: Voltjs Stored Proc returning multiple tables

  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue: Voltjs Stored Proc returning multiple tables

    The voltjs NPM package appears to have an issue. When a stored procedure returns multiple tables, the result.tables contains only one.

    Souce code from NPM package:

    QueryMessage = function(buffer) {, buffer);
    // cut out some
      if(this.fieldsPresent & PRESENT.EXCEPTION) {
        this.exception = this.readException(1);
        // seems size doesn't matter, always 1
      } else {
        // don't parse the rest if there was an exception. Bad material there.
        var resultCount = this.readShort();
        if(resultCount != 0)
          resultCount = 1;
        // there can be more than one table with rows
        this.table = new Array(resultCount);
        for(var i = 0; i < resultCount; i++) {
          this.table[i] = this.readVoltTable();
    line 125-126 (resetting result count) appears to be the offenders. Not sure what purpose they serve, but commenting them out fixes this issue.

    Note, I didn't open a github issue, because the source there is dramatically different than from NPM.