fix textParsers
some textParsers requires the input value to be a string, so convert it before calling the textParsers the same problem exists in test/integration/connection/query-test so that there also need to be a String call
This commit is contained in:
parent
aff94b0068
commit
e9838cc5bb
@ -8,7 +8,7 @@ var typeParsers = {
|
||||
|
||||
//the empty parse function
|
||||
var noParse = function(val) {
|
||||
return val;
|
||||
return String(val);
|
||||
}
|
||||
|
||||
//returns a function used to convert a specific type (specified by
|
||||
@ -21,7 +21,9 @@ var getTypeParser = function(oid, format) {
|
||||
};
|
||||
|
||||
textParsers.init(function(oid, converter) {
|
||||
typeParsers.text[oid] = converter;
|
||||
typeParsers.text[oid] = function(value) {
|
||||
return converter(String(value));
|
||||
};
|
||||
});
|
||||
|
||||
binaryParsers.init(function(oid, converter) {
|
||||
|
@ -20,6 +20,6 @@ test('simple query', function() {
|
||||
process.on('exit', function() {
|
||||
assert.equal(rows.length, 2);
|
||||
assert.equal(rows[0].length, 1);
|
||||
assert.strictEqual(rows[0] [0], '1');
|
||||
assert.strictEqual(rows[1] [0], '2');
|
||||
assert.strictEqual(String(rows[0] [0]), '1');
|
||||
assert.strictEqual(String(rows[1] [0]), '2');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user