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

varchar(MAX) isn't handled and throws error #38

Open girishrd2004 opened 9 years ago

girishrd2004 commented 9 years ago

BufferStream.prototype.assertBytesAvailable = function(amountNeeded) { if (amountNeeded + this._offset > this._buffer.length) { console.log('Need %d, length %d', amountNeeded + this._offset, this._buffer.length); throw new BufferStream.StreamIndexOutOfBoundsError('Index out of bounds'); } };

For example:

create table dummy_g (name varchar(MAX))

var stmt = conn.createStatement('select name from dummy_g');
stmt.on('row', function(row) { console.log(row) ... Will throw error with console log : Need 1429773, length 218 ( The log is removed in the master copy of code)

Can this be fixed? Similar discussion : https://github.com/cretz/node-tds/issues/5