picodb(mssql): recognize 2627 and 23000 as dup key errors
This commit is contained in:
parent
104f492301
commit
bb7f8b4621
|
|
@ -95,7 +95,10 @@ class Mssql extends Base
|
||||||
*/
|
*/
|
||||||
public function isDuplicateKeyError($code)
|
public function isDuplicateKeyError($code)
|
||||||
{
|
{
|
||||||
return $code == 2601;
|
# 2601: Cannot insert duplicate key row in object '%.*ls' with unique index '%.*ls'.
|
||||||
|
# 2627: Violation of %ls constraint '%.*ls'. Cannot insert duplicate key in object '%.*ls'.
|
||||||
|
# 23000: Integrity constraint violation
|
||||||
|
return array_search($code, ['2601','2627','23000']) !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue