mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
fix for null data row value
This commit is contained in:
parent
c8a02e19d1
commit
2617560fc7
@ -102,7 +102,8 @@ p.parse68 = function() {
|
||||
var fieldCount = this.readInt16();
|
||||
var fields = [];
|
||||
for(var i = 0; i < fieldCount; i++) {
|
||||
fields[i] = this.readString(this.readInt32());
|
||||
var length = this.readInt32();
|
||||
fields[i] = (length == -1 ? null : this.readString(length))
|
||||
};
|
||||
msg.fieldCount = fieldCount;
|
||||
msg.fields = fields;
|
||||
|
||||
@ -52,7 +52,7 @@ test('simple query', function() {
|
||||
test('after query is ended, it emits nothing else', function() {
|
||||
stream.emit('data', buffers.dataRow(["X","Y","Z"]));
|
||||
stream.emit('data', buffers.commandComplete());
|
||||
assert.length(rowData, 1);
|
||||
assert.length(rowData, 2);
|
||||
assert.equal(ended, 1);
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user