Skip to content

Commit f38f9f0

Browse files
author
Sandro Santilli
committed
Fix parsing of numeric[], previously returning array of ints
Closes brianc#304, includes testcase
1 parent 0d0737d commit f38f9f0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/types/textParsers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ var init = function(register) {
201201
register(1016, parseIntegerArray); // _int8
202202
register(1021, parseFloatArray); // _float4
203203
register(1022, parseFloatArray); // _float8
204-
register(1231, parseIntegerArray); // _numeric
204+
register(1231, parseFloatArray); // _numeric
205205
register(1014, parseStringArray); //char
206206
register(1015, parseStringArray); //varchar
207207
register(1008, parseStringArray);

test/unit/client/typed-query-results-tests.js

+8
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ test('typed results', function() {
189189
expected :function(val){
190190
assert.deepEqual(val, ['hello world']);
191191
}
192+
},{
193+
name : 'array/numeric',
194+
format : 'text',
195+
dataTypeID: 1231,
196+
actual: '{1.2,3.4}',
197+
expected :function(val){
198+
assert.deepEqual(val, [1.2,3.4]);
199+
}
192200
},
193201

194202
{

0 commit comments

Comments
 (0)