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:
committed by
GitHub
parent
32a67a4ad5
commit
74e87ccbbd
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user