Update contrib/drivers/mssql/mssql_do_insert.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
John Guo
2025-12-08 19:18:21 +08:00
committed by GitHub
parent 141b5c1778
commit ffb3aacb5b

View File

@ -42,8 +42,13 @@ func (d *Driver) DoInsert(
}
foundPrimaryKey := false
for _, primaryKey := range primaryKeys {
if _, ok := list[0][primaryKey]; ok {
foundPrimaryKey = true
for dataKey := range list[0] {
if strings.EqualFold(dataKey, primaryKey) {
foundPrimaryKey = true
break
}
}
if foundPrimaryKey {
break
}
}