From 1c0e97b52a37d49e79ca2bde230eee609b3841d9 Mon Sep 17 00:00:00 2001 From: zipg Date: Mon, 31 Aug 2026 12:31:44 +0800 Subject: [PATCH] fix(oracle): quote routine parameter aliases --- .../lib/__tests__/table/routineExecutionSql.spec.ts | 7 +++++++ apps/desktop/src/lib/table/routineParameters.ts | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts b/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts index c350ab571e..dcbc446f76 100644 --- a/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts +++ b/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts @@ -152,6 +152,13 @@ describe("SQL Server routine execution SQL", () => { expect(metadataSql).toContain("p.precision AS precision"); expect(metadataSql).toContain("p.scale AS scale"); }); + + it("quotes Oracle routine metadata aliases for legacy Oracle syntax", () => { + const sql = routineParametersQuery({ database: "XE", databaseType: "oracle", schema: "DBX_TEST", routineName: "demo" }); + + expect(sql).toContain('ARGUMENT_NAME AS "name"'); + expect(sql).toContain('DEFAULTED AS "has_default"'); + }); }); describe("XuguDB routine parameter metadata", () => { diff --git a/apps/desktop/src/lib/table/routineParameters.ts b/apps/desktop/src/lib/table/routineParameters.ts index 285eec1bcb..9a8df67866 100644 --- a/apps/desktop/src/lib/table/routineParameters.ts +++ b/apps/desktop/src/lib/table/routineParameters.ts @@ -128,11 +128,11 @@ ORDER BY p.parameter_id;`.trim(); if (options.databaseType === "oracle" || options.databaseType === "dameng" || options.databaseType === "oceanbase-oracle") { return ` SELECT - ARGUMENT_NAME AS name, - DATA_TYPE AS data_type, - IN_OUT AS mode, - POSITION AS ordinal, - DEFAULTED AS has_default + ARGUMENT_NAME AS "name", + DATA_TYPE AS "data_type", + IN_OUT AS "mode", + POSITION AS "ordinal", + DEFAULTED AS "has_default" FROM ALL_ARGUMENTS WHERE OWNER = UPPER(${schema}) AND OBJECT_NAME = UPPER(${name})