When getMaxTableNameLength returns 0 (no limit) don't try to index a String by -1.

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6019 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Wood
2011-01-14 13:47:46 +00:00
parent a62418f555
commit cd4d371590

View File

@@ -1391,7 +1391,7 @@ public class DatabaseManager
Map<String, ColumnInfo> results = new HashMap<String, ColumnInfo>();
int max = metadata.getMaxTableNameLength();
String tname = (table.length() >= max) ? table
String tname = ((max > 0) && (table.length() >= max)) ? table
.substring(0, max - 1) : table;
pkcolumns = metadata.getPrimaryKeys(catalog, schema, tname);