From 58b7d8856af7f463f4abdc48c8737d49a349b52a Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 18 Aug 2026 23:16:33 +0800 Subject: [PATCH] fix(gaussdb): persist count query DOP setting --- .../src/components/connection/ConnectionDialog.vue | 2 ++ .../connection/gaussdbConnectionDialog.spec.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 apps/desktop/src/lib/__tests__/connection/gaussdbConnectionDialog.spec.ts diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index 739616e48b..e7045c07d2 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -4108,9 +4108,11 @@ function connectionConfigForSubmit(id: string, generatedName = ""): ConnectionCo } else if (supportsGaussdbIdentifierQuoteStyle(config)) { const style = gaussdbIdentifierQuoteStyle(config); const targetServerType = gaussdbTargetServerType(config); + const countQueryDop = gaussdbCountQueryDop(config); config.external_config = undefined; setGaussdbIdentifierQuoteStyle(config, style); setGaussdbTargetServerType(config, targetServerType); + setGaussdbCountQueryDop(config, countQueryDop); } else if (!isDoltDriverProfile(config.driver_profile)) { config.external_config = undefined; } diff --git a/apps/desktop/src/lib/__tests__/connection/gaussdbConnectionDialog.spec.ts b/apps/desktop/src/lib/__tests__/connection/gaussdbConnectionDialog.spec.ts new file mode 100644 index 0000000000..df0ccbc18a --- /dev/null +++ b/apps/desktop/src/lib/__tests__/connection/gaussdbConnectionDialog.spec.ts @@ -0,0 +1,12 @@ +import { readFileSync } from "node:fs"; +import { describe, expect, it } from "vitest"; + +describe("GaussDB connection dialog persistence", () => { + it("preserves count-query DOP in submitted connection configs", () => { + const source = readFileSync(new URL("../../../components/connection/ConnectionDialog.vue", import.meta.url), "utf8"); + const submitConfig = source.slice(source.indexOf("function connectionConfigForSubmit"), source.indexOf("function connectionNameForSubmit")); + + expect(submitConfig).toContain("const countQueryDop = gaussdbCountQueryDop(config);"); + expect(submitConfig).toContain("setGaussdbCountQueryDop(config, countQueryDop);"); + }); +});