fix(mysql): reuse data tab client session

This commit is contained in:
miracle authored and GitHub committed 2026-07-10 10:56:48 +08:00
1 parent 8a30bb26f9
commit 3ff4f470f2
3 files changed
+56 -7

No files matched your search

+3 -3
View File
@@ -2555,9 +2555,9 @@ export const useQueryStore = defineStore("query", () => {
executionPromise = api.executeInManualTransaction(tab.txnSessionId, sqlToExecute, tab.database, executionSchema, pageLimit);
} else {
console.info("[DBX][executeTabSql:execute-multi:start]", { traceId, elapsed: elapsed() });
// Data tabs should reuse the already-open pool; session pools are reserved
// for query tabs/background tasks that need connection-local state isolation.
const clientSessionId = tab.mode === "query" ? tabClientSessionId(tab) : undefined;
// Query and data tabs use a tab-scoped pool so repeated executions keep
// connection-local state and avoid MySQL pool resets on every refresh.
const clientSessionId = tab.mode === "query" || tab.mode === "data" ? tabClientSessionId(tab) : undefined;
const executionOptions = {
...(typeof pageLimit === "number"
? useAgentResultSession