@lark-apaas/miaoda-cli 0.1.1-alpha.b2bef50 → 0.1.1-alpha.d095f78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -576,14 +576,18 @@ function extractTableFieldMap(s) {
|
|
|
576
576
|
function enrichMultiStatementError(err, sql) {
|
|
577
577
|
if (!(err instanceof error_1.AppError))
|
|
578
578
|
return;
|
|
579
|
-
|
|
580
|
-
|
|
579
|
+
// 用 SQL 文本判断是否多语句,而不是 partial.length——第一条就失败时
|
|
580
|
+
// partial_results=[],但仍需输出统一的多语句 envelope 字段保持格式一致。
|
|
581
|
+
const total = countStatements(sql);
|
|
582
|
+
if (total <= 1)
|
|
581
583
|
return;
|
|
582
|
-
|
|
584
|
+
const partial = Array.isArray(err.partial_results)
|
|
585
|
+
? err.partial_results
|
|
586
|
+
: [];
|
|
583
587
|
const completed = partial.map((r) => toMultiElement((0, index_1.parseSqlResult)(r)));
|
|
584
588
|
err.completed = completed;
|
|
585
589
|
err.rolled_back = inferRolledBack(completed);
|
|
586
|
-
err.total_statements =
|
|
590
|
+
err.total_statements = total;
|
|
587
591
|
// pretty 模式(非 JSON)打 per-statement breakdown 到 stderr
|
|
588
592
|
if (!(0, output_1.isJsonMode)()) {
|
|
589
593
|
writeMultiStatementBreakdown(err, completed);
|