HHH-14041 - H2Dialect: fix referential integrity constraint constraint name extraction

This commit is contained in:
Gittenburg 2020-05-24 12:35:03 +02:00 committed by Sanne Grinovero
parent bfef0df089
commit ff7aa5328f
1 changed files with 3 additions and 0 deletions

View File

@ -330,6 +330,9 @@ public class H2Dialect extends Dialect {
if ( idx > 0 ) { if ( idx > 0 ) {
constraintName = message.substring( idx + "violation: ".length() ); constraintName = message.substring( idx + "violation: ".length() );
} }
if ( sqle.getSQLState().equals("23506") ) {
constraintName = constraintName.substring( 1, constraintName.indexOf(":") );
}
} }
return constraintName; return constraintName;
} }