fix(mysql): support compatible explain formats

This commit is contained in:
t8y2 committed 2026-07-26 16:24:15 +08:00
1 parent 6a796ae97e
commit 000bb907e3
5 files changed
+163 -21

No files matched your search

@@ -22,9 +22,15 @@ const { t } = useI18n();
const activeView = ref<"tree" | "summary" | "raw" | "table">("tree");
const hasTableView = computed(() => !!props.tableResult || !!props.tableError);
watch(hasTableView, (available) => {
if (!available && activeView.value === "table") activeView.value = "tree";
});
watch(
[hasTableView, () => !!props.tableResult, () => !!props.plan, () => props.loading],
([available, hasTableResult, hasPlan, loading]) => {
if (!available && activeView.value === "table") activeView.value = "tree";
// Wait for JSON EXPLAIN to finish so regular MySQL still defaults to its visual tree.
if (!loading && hasTableResult && !hasPlan) activeView.value = "table";
},
{ immediate: true },
);
const flatRows = computed(() => {
const rows: Array<{ node: ExplainPlanNode; depth: number }> = [];