@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
- const partial = err.partial_results;
580
- if (!Array.isArray(partial) || partial.length === 0)
579
+ // SQL 文本判断是否多语句,而不是 partial.length——第一条就失败时
580
+ // partial_results=[],但仍需输出统一的多语句 envelope 字段保持格式一致。
581
+ const total = countStatements(sql);
582
+ if (total <= 1)
581
583
  return;
582
- // SQLExecuteResult[] 转成 PRD 兼容的 completed 数组
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 = countStatements(sql);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-cli",
3
- "version": "0.1.1-alpha.b2bef50",
3
+ "version": "0.1.1-alpha.d095f78",
4
4
  "description": "Miaoda 平台命令行工具,面向 Agent 调用",
5
5
  "type": "commonjs",
6
6
  "bin": {