修复业务数据盘点的 MySQL 统计结构 #105

Merged
WuYongJie merged 2 commits from fix/WuYongJie-business-data-plan-mysql-shape into main 2026-09-07 12:50:10 +08:00
Owner

问题

生产执行 business-data:plan --json 时,MySQL information_schema 统计被多包一层数组,读取 rows 报错并阻断回填前检查。

修复

  • 将每张表的统计结果改为扁平的 rows / bytes 结构
  • 新增纯单元回归测试,模拟真实 MySQL 查询返回,避免连接任何数据库

验证

  • 单元测试:1 项通过,7 assertions
  • 两份 PHP 文件语法检查通过
  • git diff --check 通过

风险

  • 不修改数据库、金额、权限、配置或页面
  • 仅修复只读运维盘点命令的结果整形
## 问题 生产执行 `business-data:plan --json` 时,MySQL `information_schema` 统计被多包一层数组,读取 `rows` 报错并阻断回填前检查。 ## 修复 - 将每张表的统计结果改为扁平的 `rows` / `bytes` 结构 - 新增纯单元回归测试,模拟真实 MySQL 查询返回,避免连接任何数据库 ## 验证 - 单元测试:1 项通过,7 assertions - 两份 PHP 文件语法检查通过 - `git diff --check` 通过 ## 风险 - 不修改数据库、金额、权限、配置或页面 - 仅修复只读运维盘点命令的结果整形
WuYongJie added 2 commits 2026-09-07 12:49:47 +08:00
WuYongJie merged commit 7c6bf6757d into main 2026-09-07 12:50:10 +08:00
WuYongJie deleted branch fix/WuYongJie-business-data-plan-mysql-shape 2026-09-07 12:50:11 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WuYongJie/CaiWuXiTong#105
No description provided.