From da818f17c2624da5ea5f462f82d69a02b04b4d07 Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Thu, 2 Nov 2017 01:16:52 +1300 Subject: [PATCH] #1190 - MySql throwing DataIntegrityException when it should throw the more specific DuplicateKeyException Ah, remove the 23000 SQLState to just use the error codes for MySql. --- .../java/io/ebean/config/dbplatform/mysql/MySqlPlatform.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/ebean/config/dbplatform/mysql/MySqlPlatform.java b/src/main/java/io/ebean/config/dbplatform/mysql/MySqlPlatform.java index bade92794..21b9c903b 100644 --- a/src/main/java/io/ebean/config/dbplatform/mysql/MySqlPlatform.java +++ b/src/main/java/io/ebean/config/dbplatform/mysql/MySqlPlatform.java @@ -42,7 +42,7 @@ public class MySqlPlatform extends DatabasePlatform { this.exceptionTranslator = new SqlErrorCodes() .addAcquireLock("1205") - .addDuplicateKey("1062", "1169", "23000") + .addDuplicateKey("1062", "1169") .addDataIntegrity("630", "839", "840", "893", "1215", "1216", "1217", "1364", "1451", "1452", "1557") .build();