GORM Playground Link

https://github.com/go-gorm/playground/pull/582

Description

Comment From: dablelv

I also encountered the same error. When I using Save method to save the unmodified object I will get the below error.

Error 1062 (23000): Duplicate entry 'xxx' for key 'PRIMARY'.

Confusingly, this occurs in the concurrent case, but not in the serial case.

Comment From: zlasd

I think we should revert commit f387433. Before the commit, Save function will examine whether the record exists and only insert it when non-exist. @jinzhu

Comment From: black-06

It was fixed in #6149 and just merged.

Comment From: monoflash

MySQL MariaDB database, same problem. Save() does not work from version 1.24.6 to latest. The latest version in which Save() works is v1.24.5.

This change has led to problems with the Save() function: https://github.com/go-gorm/gorm/commit/f3874339efd829d9841ad8fb6b50d7c2059153d2

Comment From: flin7

MySQL MariaDB database, same problem. Save() does not work from version 1.24.6 to latest. The latest version in which Save() works is v1.24.5.

This change has led to problems with the Save() function: f387433

This issue has been fixed in the master branch.