fix(sql): preserve Doris complex type field separators

This commit is contained in:
onenewcode authored and GitHub committed 2026-07-14 14:34:26 +08:00
1 parent aff9c8515d
commit a9baa8b220
3 files changed
+316 -1

No files matched your search

@@ -167,6 +167,39 @@ describe("useSqlExecution", () => {
expect(executedSql).toContain("where fp.create_at < @date_start");
});
it("sends Doris STRUCT DDL unchanged without opening the parameter dialog", async () => {
const sql = `
create table \`events\` (
\`field0\` int not null comment 'field 0',
\`field_list\` array<struct<field1:smallint, field2:int, field3:decimal(16,5), field4:varchar(255)>> comment 'field list'
)
engine = olap
properties ("replication_num" = "1");
`;
const activeTab = ref<QueryTab | undefined>(queryTab("analytics"));
const activeConnection = ref<ConnectionConfig | undefined>(connection("doris"));
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: ["ok"], rows: [[1]], affected_rows: 0, execution_time_ms: 1 };
});
vi.spyOn(useHistoryStore(), "add").mockResolvedValue(undefined);
vi.spyOn(useConnectionStore(), "refreshObjectListTreeNode").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("records a later MySQL batch error and skips metadata refresh", async () => {
const activeTab = ref<QueryTab | undefined>(queryTab("app"));
const activeConnection = ref<ConnectionConfig | undefined>(connection("mysql"));