task-195: 孤儿结果(payload) 巡检 SQL(02_orphan_result.sql,biz_file_result 无父任务)+ 8 条测试

This commit is contained in:
2026-09-05 00:06:44 +08:00
parent bcd5879a08
commit 7f7090f433
2 changed files with 25 additions and 0 deletions
@@ -0,0 +1,16 @@
-- =============================================================
-- 巡检 02:孤儿结果记录(biz_file_result 无对应任务)— 只读报表(task-195)
-- 结果(payload)行丢失父任务即为孤儿;仅副本库只读执行,无副作用。
-- 结果按 updated_at 升序;每批建议 limit <= 500。
-- =============================================================
SELECT r.id,
r.task_id,
r.module_type,
r.source_file_url,
r.result_file_url,
r.user_id,
r.updated_at
FROM biz_file_result r
WHERE NOT EXISTS (SELECT 1 FROM biz_file_task t WHERE t.id = r.task_id)
ORDER BY r.updated_at ASC
LIMIT 200;
@@ -0,0 +1,9 @@
package com.nanri.aiimage.config;
/** task-195:孤儿结果(payload) 巡检 SQL 契约。 */
class OrphanResultSqlInspectionTest extends InspectionSqlFileTestBase {
@Override
String fileName() {
return "02_orphan_result.sql";
}
}