Emit message if the returned row is bigger than limit
This commit is contained in:
parent
83a946f61c
commit
fa8cfcaebf
@ -153,6 +153,10 @@ Client.prototype.connect = function(callback) {
|
||||
self.emit('notification', msg);
|
||||
});
|
||||
|
||||
con.on('maxRowSize', function (msg) {
|
||||
self.emit('maxRowSize', msg);
|
||||
});
|
||||
|
||||
//process possible callback argument to Client#connect
|
||||
if (callback) {
|
||||
callback(null, self);
|
||||
|
@ -10,6 +10,8 @@ var net = require('net');
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var util = require('util');
|
||||
|
||||
var defaults = require(__dirname + '/defaults');
|
||||
|
||||
var Writer = require('buffer-writer');
|
||||
var Reader = require('packet-reader');
|
||||
|
||||
@ -521,6 +523,10 @@ var DataRowMessage = function(length, fieldCount) {
|
||||
|
||||
//extremely hot-path code
|
||||
Connection.prototype.parseD = function(buffer, length) {
|
||||
if (Number.isFinite(defaults.maxRowSize) && length > defaults.maxRowSize) {
|
||||
return new Message('maxRowSize', length);
|
||||
}
|
||||
|
||||
var fieldCount = this.parseInt16(buffer);
|
||||
var msg = new DataRowMessage(length, fieldCount);
|
||||
for(var i = 0; i < fieldCount; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user