Skip to content

Commit afead5b

Browse files
sehropebendrucker
authored andcommitted
fix: Normalize text protocol handling of numeric and numeric[] types
Normalizes handling of numeric[] types to always return a string array representation of the value for both the text. Previously numeric array types were being returned as an array of Number which could lose precision. Closes #91
1 parent a4a1188 commit afead5b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/textParsers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ var init = function (register) {
186186
register(1017, parsePointArray) // point[]
187187
register(1021, parseFloatArray) // _float4
188188
register(1022, parseFloatArray) // _float8
189-
register(1231, parseFloatArray) // _numeric
189+
register(1231, parseStringArray) // _numeric
190190
register(1014, parseStringArray) // char
191191
register(1015, parseStringArray) // varchar
192192
register(1008, parseStringArray)

test/types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ exports['array/numeric'] = {
289289
id: 1231,
290290
tests: [
291291
['{1.2,3.4}', function (t, value) {
292-
t.deepEqual(value, [1.2, 3.4])
292+
t.deepEqual(value, ['1.2', '3.4'])
293293
}]
294294
]
295295
}

0 commit comments

Comments
 (0)