HHH-11009 - Fix exception message to specify unique constraint only when index is unique.

This commit is contained in:
Chris Cranford 2016-07-30 13:07:31 -05:00
parent 58e4f89f47
commit 9b9becb903
1 changed files with 7 additions and 1 deletions

View File

@ -2039,7 +2039,13 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
} }
if ( unbound.size() > 0 || unboundNoLogical.size() > 0 ) { if ( unbound.size() > 0 || unboundNoLogical.size() > 0 ) {
StringBuilder sb = new StringBuilder( "Unable to create unique key constraint (" ); StringBuilder sb = new StringBuilder( "Unable to create " );
if ( unique ) {
sb.append( "unique key constraint (" );
}
else {
sb.append( "index (" );
}
for ( String columnName : columnNames ) { for ( String columnName : columnNames ) {
sb.append( columnName ).append( ", " ); sb.append( columnName ).append( ", " );
} }