fix(oracle): reload large values through rowid-wrapped select

Refs: #7082
This commit is contained in:
t8y2 committed 2026-08-27 10:43:54 +08:00
1 parent 4a3d63b09a
commit afcfa59d0b
4 files changed
+71 -1

No files matched your search

@@ -5104,6 +5104,7 @@ async function hydrateVisibleLargeValuePreviews(generation: number) {
whereInput: predicates.map((predicate) => `(${predicate})`).join(" OR "),
limit: requests.size,
offset: 0,
includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys, tableMeta.tableType),
});
if (!visibleLargeValuePreviewActive || generation !== visibleLargeValuePreviewRequestedGeneration || props.result !== sourceResult) return;
const connection = connectionStore.getConfig(props.connectionId);
@@ -5270,6 +5271,7 @@ async function fetchLargeValueRequestChunk(columnIndex: number, requests: LargeV
whereInput: predicates.map((predicate) => `(${predicate})`).join(" OR "),
limit: requests.length,
offset: 0,
includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys, tableMeta.tableType),
});
const connection = props.connectionId ? connectionStore.getConfig(props.connectionId) : undefined;
const results = await api.executeMulti(props.connectionId!, props.executionDatabase ?? props.database ?? "", sql, undefined, uuid(), {
@@ -0,0 +1,29 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const dataGridSource = readFileSync(new URL("../DataGrid.vue", import.meta.url), "utf8");
function functionSource(name: string, nextName: string): string {
const start = dataGridSource.indexOf(`function ${name}`);
const relativeEnd = dataGridSource.slice(start).search(new RegExp(`\\n(?:async\\s+)?function\\s+${nextName}\\b`));
expect(start).toBeGreaterThanOrEqual(0);
expect(relativeEnd).toBeGreaterThan(0);
return dataGridSource.slice(start, start + relativeEnd);
}
describe("DataGrid large-value reload SQL", () => {
it("projects the synthetic rowid through the rowid-wrapped select on full-value reloads", () => {
const fetchChunkSource = functionSource("fetchLargeValueRequestChunk", "resolveLargeValueCells");
// Keyless Oracle tables address rows via the hidden __DBX_ROWID alias; the
// reload must opt into the ROWIDTOCHAR inline view so the generated SQL
// never references __DBX_ROWID as a base-table column (ORA-00904).
expect(fetchChunkSource).toContain("includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys, tableMeta.tableType)");
});
it("keeps the visible-preview hydration consistent with the synthetic key", () => {
const hydrateSource = functionSource("hydrateVisibleLargeValuePreviews", "runVisibleLargeValuePreviewHydration");
expect(hydrateSource).toContain("includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys, tableMeta.tableType)");
});
});