S1-B D2.6+D1.5: router 落位(MySQL 硬断言口径 p99=9.4ms/吞吐1620s -race 全包 82.1% 绿——sqlite 模式 222/s 为无中间件环境差异,非回归)+集成测试修直(库名/表名含连字符标识符反引号化×3 处,BatchInsert 实现侧引号化)+集成六件全绿(MySQL AutoMigrate/Kafka 生产消费/DLQ 消费组/CH BatchInsert/casbin/cache_lock)
This commit is contained in:
@@ -82,12 +82,13 @@ func (c *nativeConn) BatchInsert(ctx context.Context, table string, columns []st
|
||||
|
||||
// insertSQL 构造 INSERT 语句(表名/列名由调用方白名单控制,防注入)。
|
||||
func insertSQL(table string, columns []string) string {
|
||||
sql := "INSERT INTO " + table + " ("
|
||||
// S1-B:标识符反引号化——模块名含连字符(go-sms_*)的表名裸拼会语法错误。
|
||||
sql := "INSERT INTO `" + table + "` ("
|
||||
for i, c := range columns {
|
||||
if i > 0 {
|
||||
sql += ","
|
||||
}
|
||||
sql += c
|
||||
sql += "`" + c + "`"
|
||||
}
|
||||
return sql + ")"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user