Improved detection of duplicate key errors
authorMarcel Werk <burntime@woltlab.com>
Fri, 31 Jul 2020 15:29:09 +0000 (17:29 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 31 Jul 2020 15:29:09 +0000 (17:29 +0200)
wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php

index 1126fae67daf53468c0032cd889edf265a9195c0..107e989ad5f48ac378204bb0cc027667685134aa 100644 (file)
@@ -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;
                        }