task-195: 孤儿结果(payload) 巡检 SQL(02_orphan_result.sql,biz_file_result 无父任务)+ 8 条测试
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user