fix(db2): 修复空values和未知运算符问题,更新审计文档

P3-5: INSERT/UPDATE 空 values 前置校验,不再生成无效 SQL
P3-6: 未知 WHERE 运算符立即报错,不再静默跳过

审计文档:新增并发性分析章节,更新进度至 8/11 已修复

剩余 3 项 P3(schema缓存失效、limit负值、条件数上限)待后续迭代
This commit is contained in:
qing committed 2026-08-07 07:07:55 +00:00
1 parent ec626dc8d5
commit 176fb13908
2 files changed
+133 -19

No files matched your search

+6
View File
@@ -478,6 +478,8 @@ private:
wc.params.push_back(_coerce_value(ci, item));
}
parts.push_back(col + " IN (" + placeholders + ")");
} else {
throw std::runtime_error("unknown operator: " + op);
}
}
} else {
@@ -630,6 +632,8 @@ private:
DbConn& conn = _get_conn();
const json::object& vals = req.at("values").as_object();
if (vals.empty())
throw std::runtime_error("insert requires non-empty 'values'");
// 建列名 -> ColInfo 映射
std::unordered_map<std::string, ColInfo> col_map;
@@ -672,6 +676,8 @@ private:
DbConn& conn = _get_conn();
const json::object& vals = req.at("values").as_object();
if (vals.empty())
throw std::runtime_error("update requires non-empty 'values'");
std::unordered_map<std::string, ColInfo> col_map;
for (auto& c : cols) col_map[c.name] = c;