From: Marcel Werk Date: Fri, 31 Jul 2020 15:29:09 +0000 (+0200) Subject: Improved detection of duplicate key errors X-Git-Tag: 5.3.0_Alpha_1~108 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=64cd3484e47ba92c77cbcb5c3a3538795ddf6a0d;p=GitHub%2FWoltLab%2FWCF.git Improved detection of duplicate key errors --- diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php index 1126fae67d..107e989ad5 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php @@ -138,7 +138,7 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I } catch (DatabaseQueryExecutionException $e) { // Error code 23000 = duplicate key - if ($e->getCode() == '23000') { + if ($e->getCode() == '23000' && $e->getDriverCode() == '1062') { return null; }