Update contrib/drivers/dm/dm_do_insert.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
John Guo
2025-12-08 19:17:41 +08:00
committed by GitHub
parent f6a7fd23f1
commit 36d63354e7

View File

@ -76,8 +76,13 @@ func (d *Driver) doMergeInsert(
}
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
}
}