nulls supported in all currently supported type coercions

This commit is contained in:
brianc 2010-10-30 21:04:40 -05:00
parent a928453d69
commit 405fbbec12
2 changed files with 8 additions and 1 deletions

View File

@ -213,7 +213,9 @@ p.onDataRow = function(msg) {
var converters = this.converters || [];
var len = msg.fields.length;
for(var i = 0; i < len; i++) {
fields[i] = this.converters[i] (fields[i]);
if(fields[i] !== null) {
fields[i] = this.converters[i] (fields[i]);
}
}
msg.fields = fields;
this.emit('row', msg);

View File

@ -58,6 +58,11 @@ test('typed results', function() {
dataTypeID: 16,
actual: 'f',
expected: false
},{
name: 'boolean null',
dataTypeID: 16,
actual: null,
expected: null
}];