fix(oracle): quote routine parameter aliases

This commit is contained in:
zipg
2026-08-31 12:31:44 +08:00
committed by GitHub
parent b7d33e375f
commit 1c0e97b52a
2 changed files with 12 additions and 5 deletions
@@ -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", () => {
@@ -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})