ReadableTrackingBuffer.prototype.assertEnoughLeftFor - throwing oob error continuosly
why ReadableTrackingBuffer.prototype.assertEnoughLeftFor is throwing oob error continuosly. is this normal and how can I avoid the break on this throw
I just wrote up Tokens that span packets, which I hope goes some way to explaining why that exception is thrown and caught.
I use node.js throw visual studio and the it braked the execution every time in that point. The Object thrown is not a predefined Error object and I should add an exception avoid rule to visual studio for a #
Hi
I am seeing same issues trying out various MSSQL node connectors any help appreciated thanks

I am seeing the same thing from a very basic select statement:
SELECT [ComponentID], [Component].[Name] AS [ControlName], [FriendlyName] FROM [Component] WHERE [Component].[ProductFamilyID] = 16
Which results in this:

This is something that will be fixed by #225.
This was fixed with #285 which was merged and released with v1.12.0.
Tried to input bad credentials. Still throws here on the latest version
buffer.js:582
throw new RangeError('Trying to access beyond buffer length');
^
RangeError: Trying to access beyond buffer length
at checkOffset (buffer.js:582:11)
at Buffer.readUInt8 (buffer.js:588:5)
at Packet.isLast (/DataAPI/node_modules/tedious/lib/packet.js:121:29)
at ReadablePacketStream.<anonymous> (/DataAPI/node_modules/tedious/lib/message-io.js:102:18)
at ReadablePacketStream.EventEmitter.emit (events.js:95:17)
at readableAddChunk (/DataAPI/node_modules/tedious/node_modules/readable-stream/lib/_stream_readable.js:199:16)
at ReadablePacketStream.Readable.push (/DataAPI/node_modules/tedious/node_modules/readable-stream/lib/_stream_readable.js:163:10)
at ReadablePacketStream.Transform.push (/DataAPI/node_modules/tedious/node_modules/readable-stream/lib/_stream_transform.js:133:32)
at ReadablePacketStream._transform (/DataAPI/node_modules/tedious/lib/message-io.js:68:16)
at ReadablePacketStream.Transform._read (/DataAPI/node_modules/tedious/node_modules/readable-stream/lib/_stream_transform.js:172:10)
Can you explain what you mean with tried to input bad credentials?
@arthurschreiber Well I mean wrong credentials like a non suitable host/port/...
After some testing, I narrowed it down to a single reproducible weird case. When I input a MySQL server host and its port, the server crashes with the above error. Here's some code:
var Connection = require('tedious').Connection;
var config = {
server: 'mysql-micro.*******.eu-west-1.rds.amazonaws.com',
userName: 'hillel',
password: '******',
options: {
port: 3306,
database: 'test',
rowCollectionOnDone: true,
rowCollectionOnRequestCompletion: true
}
};
var connection = new Connection(config);
connection.on('connect', function(err) {
connection.close();
});
I tried it wit non existing hosts and Oracle, PostgreSQL and DB2 hosts. These don't crash. Only a MySQL host crashes as far as I can tell
After some further testing on my DBs, I can make a quick list: Working (connection times out):
- Oracle
- PostgreSQL
- IBM DB2
- MongoDB
Crashing:
- MySQL
- MariaDB (expect-idly)
- Cassandra
- SAP Adaptive Server Enterprise
Okay. This is weird. I don't think anyone expects tedious to be able to connect to any of those servers, but we shouldn't crash the whole process either. I'll take a look.
I'm not expecting so. I'm just building a unified querying client and have mistakenly clicked on the wrong connector, thus discovering this issue
Meet same issue.
A years passed, and in the fall of 2018 I've met the same issue. Any news, guys? Shouldn't we reopen this issue?
@tverdohleb @RogerKang, if you specify a different server in the config, what error message do you get back?