From 23d9b14080164d2102ad6285f833bbabf39a5661 Mon Sep 17 00:00:00 2001 From: "Erik.Klusovskij" Date: Thu, 15 May 2025 14:30:46 +0300 Subject: [PATCH 1/3] Solving 32 NUL bytes problem --- package-lock.json | 17 +++++++++++++++++ package.json | 1 + resources/oe/src/oeCore.i | 2 ++ src/repo/client/AClient.ts | 5 ++++- src/view/app/Query/query.tsx | 1 + 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 070d682a..e7948a90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "faker": "^5.5.3", "fs": "^0.0.1-security", "html-webpack-plugin": "^5.5.3", + "iconv-lite": "^0.6.3", "jsonminify": "^0.4.2", "path": "^0.12.7", "raw-loader": "^4.0.2", @@ -7140,6 +7141,17 @@ "node": ">=10.17.0" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/icss-utils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", @@ -11987,6 +11999,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "node_modules/scheduler": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", diff --git a/package.json b/package.json index 513e999e..a4f40020 100644 --- a/package.json +++ b/package.json @@ -429,6 +429,7 @@ "faker": "^5.5.3", "fs": "^0.0.1-security", "html-webpack-plugin": "^5.5.3", + "iconv-lite": "^0.6.3", "jsonminify": "^0.4.2", "path": "^0.12.7", "raw-loader": "^4.0.2", diff --git a/resources/oe/src/oeCore.i b/resources/oe/src/oeCore.i index af2d3080..ace2ef6a 100644 --- a/resources/oe/src/oeCore.i +++ b/resources/oe/src/oeCore.i @@ -63,6 +63,8 @@ FUNCTION CREATE_DEBUG RETURNS Progress.Json.ObjectModel.JsonObject (tmpDate AS D jsonDebug:Add(SUBSTITUTE("start&1", cProcedure), tmpDate). jsonDebug:Add(SUBSTITUTE("end&1", cProcedure), NOW). jsonDebug:Add(SUBSTITUTE("time&1", cProcedure), NOW - tmpDate). + jsonDebug:Add(SUBSTITUTE("cpstream&1", cProcedure), SESSION:CPSTREAM). + jsonDebug:Add(SUBSTITUTE("cpinternal&1", cProcedure), SESSION:CPINTERNAL). RETURN jsonDebug. END FUNCTION. diff --git a/src/repo/client/AClient.ts b/src/repo/client/AClient.ts index 26d4f4fc..10e4e38f 100644 --- a/src/repo/client/AClient.ts +++ b/src/repo/client/AClient.ts @@ -1,5 +1,6 @@ import * as Net from 'net'; import { ConnectionParams } from '../../view/app/model'; +import { decode } from 'iconv-lite'; export class AClient { protected connectionParams: ConnectionParams; @@ -32,7 +33,9 @@ export class AClient { this.client.on('data', (chunk) => { console.log('V2: Data received from the server'); - this.data += chunk.toString(); + const a = decode(chunk, 'windows-1252').replace(/\x00+$/, ''); + + this.data += a; if (this.data.endsWith('\n')) { this.dataFinish(this.data); console.log('V2: Data finish'); diff --git a/src/view/app/Query/query.tsx b/src/view/app/Query/query.tsx index 56bd2595..b9655cd3 100644 --- a/src/view/app/Query/query.tsx +++ b/src/view/app/Query/query.tsx @@ -184,6 +184,7 @@ function QueryForm({ tableData, tableName, isReadOnly }: IConfigProps) { }; const handleData = (message: any) => { + console.log('MY LOG' + message.data.columns); if (message.data.error) { setErrorObject({ error: message.data.error, From 0535bcf94b840663e520e0f3411d195f8db3febc Mon Sep 17 00:00:00 2001 From: "Erik.Klusovskij" Date: Thu, 15 May 2025 14:36:13 +0300 Subject: [PATCH 2/3] fixing compilation issues --- src/repo/client/AClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repo/client/AClient.ts b/src/repo/client/AClient.ts index 10e4e38f..e3851c54 100644 --- a/src/repo/client/AClient.ts +++ b/src/repo/client/AClient.ts @@ -33,7 +33,7 @@ export class AClient { this.client.on('data', (chunk) => { console.log('V2: Data received from the server'); - const a = decode(chunk, 'windows-1252').replace(/\x00+$/, ''); + const a = decode(chunk, 'windows-1252').replace(/[\x00]+$/, ''); this.data += a; if (this.data.endsWith('\n')) { From 9c77436fa12de6c30823a9c8daadedcea6cc7d3f Mon Sep 17 00:00:00 2001 From: "Erik.Klusovskij" Date: Thu, 15 May 2025 14:39:04 +0300 Subject: [PATCH 3/3] Fixing compilation issues --- src/repo/client/AClient.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/repo/client/AClient.ts b/src/repo/client/AClient.ts index e3851c54..8eb2090e 100644 --- a/src/repo/client/AClient.ts +++ b/src/repo/client/AClient.ts @@ -33,7 +33,8 @@ export class AClient { this.client.on('data', (chunk) => { console.log('V2: Data received from the server'); - const a = decode(chunk, 'windows-1252').replace(/[\x00]+$/, ''); + // eslint-disable-next-line no-control-regex + const a = decode(chunk, 'windows-1252').replace(/\x00+$/, ''); this.data += a; if (this.data.endsWith('\n')) {