fix(sql): preserve Oracle database link references

This commit is contained in:
t8y2 committed 2026-08-02 16:03:41 +08:00
1 parent 7206900313
commit 2220eed285
3 files changed
+40 -1

No files matched your search

@@ -245,6 +245,31 @@ describe("useSqlExecution", () => {
expect(executeCurrentSql).toHaveBeenCalledWith(resolvedSql, { openInNewResultTab: true });
});
it("executes Oracle database-link queries without opening the parameter dialog", async () => {
const sql = "SELECT 1 FROM DUAL@WDHIS160;";
const activeTab = ref<QueryTab | undefined>(queryTab("ORCL"));
const activeConnection = ref<ConnectionConfig | undefined>(connection("oracle"));
const activeOutputView = ref<"result" | "summary" | "explain" | "chart">("result");
const queryStore = useQueryStore();
const executeCurrentSql = vi.spyOn(queryStore, "executeCurrentSql").mockImplementation(async () => {
if (activeTab.value) activeTab.value.result = { columns: ["1"], rows: [[1]], affected_rows: 0, execution_time_ms: 1 };
});
vi.spyOn(useHistoryStore(), "add").mockResolvedValue(undefined);
const execution = useSqlExecution({
activeTab: computed(() => activeTab.value),
activeConnection: computed(() => activeConnection.value),
executableSql: computed(() => sql),
activeOutputView,
});
await execution.tryExecute();
expect(execution.showSqlParameterDialog.value).toBe(false);
expect(execution.sqlParameterNames.value).toEqual([]);
expect(executeCurrentSql).toHaveBeenCalledWith(sql, {});
});
it("sends native SET variables without client-side expansion", async () => {
const activeTab = ref<QueryTab | undefined>(queryTab("app"));
const activeConnection = ref<ConnectionConfig | undefined>(connection("mysql"));