column name [201006] #66

irakli-janiashvili opened this Issue Dec 11, 2012 · 1 comment


None yet

2 participants


For example I have a simple query

SELECT [201006] FROM test

column name (201006) causes error. here is the stack trace

        throw error;
TypeError: Cannot read property 'type' of undefined
    at parse (/[myapppath]/node_modules/tedious/lib/value-parser.js:29:18)
    at Object.parser [as 209] (/[myapppath]/node_modules/tedious/lib/token/row-token-parser.js:13:13)
    at Parser.nextToken (/[myapppath]/node_modules/tedious/lib/token/token-stream-parser.js:81:35)
    at Parser.addBuffer (/[myapppath]/node_modules/tedious/lib/token/token-stream-parser.js:65:17)
    at Connection.sendDataToTokenStreamParser (/[myapppath]/node_modules/tedious/lib/connection.js:527:35)
    at (/[myapppath]/node_modules/tedious/lib/connection.js:189:23)
    at Connection.dispatchEvent (/[myapppath]/node_modules/tedious/lib/connection.js:433:59)
    at MessageIO.Connection.connectOnPort (/[myapppath]/node_modules/tedious/lib/connection.js:387:20)
    at MessageIO.EventEmitter.emit (events.js:96:17)
    at MessageIO.eventData (/[myapppath]/node_modules/tedious/lib/message-io.js:57:12)
@pekim pekim added a commit that referenced this issue Dec 30, 2012
@pekim pekim Don't make column value or metadata available by column name when the…
… name is numeric.

issue #66

Request's row and columnMetadata events expose a columns array. The columns can be accessed in the array either by index or name. This doesn't work too well if the column name is numeric, as it's indistinguishable from an array index.

Rather that significantly changing the exposed API, columns with numeric names are no longer exposed by name (only by index). It's not a great solution, but it at least avoids an error being thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment