Skip to content

Commit f9d9736

Browse files
committed
fix: reviver function when parsing server response to avoid truncation of large integers
1 parent 083ba23 commit f9d9736

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/connection/sqlJob.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ export class OldSQLJob extends SQLJob {
7373
outString = ``;
7474
if (this.isTracingChannelData) ServerComponent.writeOutput(thisMsg);
7575
try {
76-
let response: ServerResponse = JSON.parse(thisMsg);
76+
let response: ServerResponse = JSON.parse(thisMsg, (_key, value, context) => {
77+
if (typeof value === 'number' && ('' + value !== context.source)) {
78+
return context.source;
79+
}
80+
return value;
81+
});
7782
this.responseEmitter.emit(response.id, response);
7883
} catch (e: any) {
7984
console.log(`Error: ` + e);

0 commit comments

Comments
 (0)