Author: doogie
Date: Sun May 30 22:08:18 2010
New Revision: 949621
URL:
http://svn.apache.org/viewvc?rev=949621&view=revLog:
Fetching an index from the database requires the tableName pattern to *not* have the schemaName on the front. So, remove it when querying, but then add it back when checking if the table is allowed.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java?rev=949621&r1=949620&r2=949621&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java Sun May 30 22:08:18 2010
@@ -1576,6 +1576,9 @@ public class DatabaseUtil {
}
}
for (String curTableName: tableNames) {
+ if (lookupSchemaName != null) {
+ curTableName = curTableName.substring(lookupSchemaName.length() + 1);
+ }
ResultSet rsCols = null;
try {
@@ -1599,6 +1602,9 @@ public class DatabaseUtil {
if (needsUpperCase && tableName != null) {
tableName = tableName.toUpperCase();
}
+ if (lookupSchemaName != null) {
+ tableName = lookupSchemaName + '.' + tableName;
+ }
if (!tableNames.contains(tableName)) continue;
String indexName = rsCols.getString("INDEX_NAME");