fix(doris): qualify external catalog tables

This commit is contained in:
jischeng authored and GitHub committed 2026-07-13 23:56:53 +08:00
1 parent c9c2fddfe2
commit a9ca66a829
21 files changed
+222 -44

No files matched your search

@@ -71,6 +71,7 @@ describe("queryStore table data refresh", () => {
const publicTabId = store.createTab("pg-1", "app", "users", "data", "public");
store.setTableMeta(publicTabId, {
database: "analytics",
schema: "public",
tableName: "users",
tableType: "TABLE",
@@ -106,6 +107,7 @@ describe("queryStore table data refresh", () => {
expect(mocks.buildTableSelectSql).toHaveBeenCalledWith({
databaseType: "postgres",
identifierQuote: undefined,
database: "analytics",
schema: "public",
tableName: "users",
tableType: "TABLE",
+9 -4
View File
@@ -870,7 +870,7 @@ export const useQueryStore = defineStore("query", () => {
return tabs.value.find((tab) => tab.connectionId === connectionId && tab.database === database && tab.title === title && tab.mode === mode && (tab.schema || "") === (schema || ""));
}
function createTab(connectionId: string, database: string, title?: string, mode: QueryTab["mode"] = "query", schema?: string, initialSql?: string) {
function createTab(connectionId: string, database: string, title?: string, mode: QueryTab["mode"] = "query", schema?: string, initialSql?: string, catalog?: string) {
if (title) {
const existing = findTabByIdentity(connectionId, database, title, mode, schema);
if (existing) {
@@ -887,6 +887,7 @@ export const useQueryStore = defineStore("query", () => {
connectionId,
database,
schema,
catalog,
sql: initialSql ?? "",
isExecuting: false,
isCancelling: false,
@@ -1194,7 +1195,7 @@ export const useQueryStore = defineStore("query", () => {
tab.structureInitialTabRequestId = (tab.structureInitialTabRequestId ?? 0) + 1;
}
function openTableStructure(connectionId: string, database: string, schema?: string, tableName?: string, initialTab?: TableInfoTab, initialTarget?: TableStructureEditorTarget) {
function openTableStructure(connectionId: string, database: string, schema?: string, tableName?: string, initialTab?: TableInfoTab, initialTarget?: TableStructureEditorTarget, catalog?: string) {
const resolvedTableName = tableName || "";
if (resolvedTableName) {
const existing = tabs.value.find((tab) => tab.mode === "structure" && tab.connectionId === connectionId && tab.database === database && (tab.structureTableName || "") === resolvedTableName);
@@ -1213,6 +1214,7 @@ export const useQueryStore = defineStore("query", () => {
connectionId,
database,
schema,
catalog,
sql: "",
isExecuting: false,
isCancelling: false,
@@ -1704,6 +1706,7 @@ export const useQueryStore = defineStore("query", () => {
const sql = await buildTableSelectSql({
databaseType: effectiveDbType,
identifierQuote,
database: tableMeta.database,
schema: tableMeta.schema,
tableName: tableMeta.tableName,
tableType: tableMeta.tableType,
@@ -2601,7 +2604,7 @@ export const useQueryStore = defineStore("query", () => {
mongoCommands = splitMongoCommandRanges(sql);
}
const effectiveDbType = effectiveDatabaseTypeForConnection(conn);
const executionDatabase = dataTabExecutionDatabase(conn, tab.database, tab.mode === "data" ? tab.tableMeta?.catalog : undefined);
const executionDatabase = dataTabExecutionDatabase(conn, tab.database, tab.mode === "data" ? tab.tableMeta?.catalog : tab.catalog);
const useAgentCursor = usesAgentCursorForQuery(conn?.db_type);
const queryTimeoutSecs = queryTimeoutSecsForConnection(conn);
const settingsStore = useSettingsStore();
@@ -3044,6 +3047,7 @@ export const useQueryStore = defineStore("query", () => {
databaseType: effectiveDbType,
identifierQuote: useConnectionStore().connectionIdentifierQuote?.(current.connectionId),
catalog: tableMeta.catalog,
database: tableMeta.database,
schema: tableMeta.schema,
tableName: tableMeta.tableName,
whereInput: current.whereInput?.trim() || undefined,
@@ -3068,7 +3072,7 @@ export const useQueryStore = defineStore("query", () => {
countQueryTotalRowsInBackground({
tabId: id,
connectionId: current.connectionId,
database: current.database,
database: executionDatabase,
schema: current.schema,
countSql,
countSqlTarget: dataCountTarget
@@ -3672,6 +3676,7 @@ export const useQueryStore = defineStore("query", () => {
const sql = await api.buildTableSelectSql({
databaseType: effectiveDbType,
identifierQuote,
database: tableMeta.database,
schema: tableMeta.schema,
tableName: tableMeta.tableName,
tableType: tableMeta.tableType,