[v10.0.x] SQLStore: Align SQLite IsUniqueConstraintViolation() with other backend implementations (#69227)
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
(cherry picked from commit 74e87ccbbd)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
co-authored by
Sofia Papagiannaki
parent
9df2e093b1
commit
a81452b437
@@ -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