cretz / node-tds

Pure JS implementation of TDS protocol for Microsoft SQL Server
http://cretz.github.com/node-tds
MIT License
104 stars 23 forks source link

Fix StreamIndexOutOfBoundsError w/null value (0xFFFF val.length) #34

Open martijndeh opened 11 years ago

martijndeh commented 11 years ago

I assume a nullable column with a value's length of 0xFFFF should actually become null (see #33). The length is set based on emptyPossible so that is does not break the logic in the isNull method and returns a null value (instead of an empty string).

I do not know if a length of 0xFFFF should always be null or perhaps only for uint16LE length type or VarChar sql types. I would appreciate it if anyone could check this.

Sorry I don't have any tests.