SQLStore: Align SQLite IsUniqueConstraintViolation() with other backend implementations (#69224)

* Add integration test for primary key and unique constrain violation

* Align SQLite IsUniqueConstraintViolation implementation with other backends
This commit is contained in:
Sofia Papagiannaki authored and GitHub committed 2023-05-29 14:45:08 +00:00
1 parent 32a67a4ad5
commit 74e87ccbbd
2 files changed
+53 -1

No files matched your search

@@ -148,7 +148,7 @@ func (db *SQLite3) ErrorMessage(err error) string {
}
func (db *SQLite3) IsUniqueConstraintViolation(err error) bool {
return db.isThisError(err, int(sqlite3.ErrConstraintUnique))
return db.isThisError(err, int(sqlite3.ErrConstraintUnique)) || db.isThisError(err, int(sqlite3.ErrConstraintPrimaryKey))
}
func (db *SQLite3) IsDeadlock(err error) bool {