diff --git a/contrib/drivers/dm/dm_do_insert.go b/contrib/drivers/dm/dm_do_insert.go index 01a00354f..3941342ee 100644 --- a/contrib/drivers/dm/dm_do_insert.go +++ b/contrib/drivers/dm/dm_do_insert.go @@ -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 } }