You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/12/15 12:35:50 UTC
svn commit: r1214711 - in /incubator/lcf/branches/CONNECTORS-313: ./
framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Author: kwright
Date: Thu Dec 15 11:35:50 2011
New Revision: 1214711
URL: http://svn.apache.org/viewvc?rev=1214711&view=rev
Log:
Pull up fix for CONNECTORS-320 so it doesn't block us
Modified:
incubator/lcf/branches/CONNECTORS-313/ (props changed)
incubator/lcf/branches/CONNECTORS-313/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Propchange: incubator/lcf/branches/CONNECTORS-313/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 15 11:35:50 2011
@@ -13,3 +13,4 @@
/incubator/lcf/branches/CONNECTORS-287:1200390-1210394
/incubator/lcf/branches/CONNECTORS-290:1204836-1205502
/incubator/lcf/branches/CONNECTORS-32:1092556-1094216
+/incubator/lcf/trunk:1214707
Modified: incubator/lcf/branches/CONNECTORS-313/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-313/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java?rev=1214711&r1=1214710&r2=1214711&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-313/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java (original)
+++ incubator/lcf/branches/CONNECTORS-313/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java Thu Dec 15 11:35:50 2011
@@ -54,6 +54,7 @@ public class DBInterfaceHSQLDB extends D
protected int serializableDepth = 0;
protected boolean isRemote;
protected String schemaName;
+ protected String schemaNameForQueries;
public DBInterfaceHSQLDB(IThreadContext tc, String databaseName, String userName, String password)
throws ManifoldCFException
@@ -64,9 +65,15 @@ public class DBInterfaceHSQLDB extends D
this.userName = userName;
this.password = password;
if (this.isRemote)
+ {
schemaName = databaseName;
+ schemaNameForQueries = databaseName;
+ }
else
+ {
schemaName = null;
+ schemaNameForQueries = "PUBLIC";
+ }
}
protected void setupSchema()
@@ -612,7 +619,7 @@ public class DBInterfaceHSQLDB extends D
// Now, look for schema
params.clear();
- params.add(databaseName);
+ params.add(databaseName.toUpperCase());
IResultSet schemaResult = masterDatabase.executeQuery("SELECT * FROM INFORMATION_SCHEMA.SYSTEM_SCHEMAS WHERE TABLE_SCHEM=?",params,
null,null,null,true,-1,null,null);
if (schemaResult.getRowCount() == 0)
@@ -781,16 +788,17 @@ public class DBInterfaceHSQLDB extends D
{
StringBuilder query = new StringBuilder();
List list = new ArrayList();
+ list.add(schemaNameForQueries.toUpperCase());
list.add(tableName.toUpperCase());
query.append("SELECT column_name, is_nullable, data_type, character_maximum_length ")
- .append("FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='PUBLIC' AND table_name=?");
+ .append("FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema=? AND table_name=?");
IResultSet set = performQuery(query.toString(),list,cacheKeys,queryClass);
if (set.getRowCount() == 0)
return null;
query = new StringBuilder();
query.append("SELECT column_name ")
- .append("FROM INFORMATION_SCHEMA.SYSTEM_PRIMARYKEYS WHERE table_schem='PUBLIC' AND table_name=?");
+ .append("FROM INFORMATION_SCHEMA.SYSTEM_PRIMARYKEYS WHERE table_schem=? AND table_name=?");
IResultSet primarySet = performQuery(query.toString(),list,cacheKeys,queryClass);
String primaryKey = null;
if (primarySet.getRowCount() != 0)
@@ -835,8 +843,9 @@ public class DBInterfaceHSQLDB extends D
Map<String,IndexDescription> rval = new HashMap<String,IndexDescription>();
String query = "SELECT index_name,column_name,non_unique,ordinal_position FROM INFORMATION_SCHEMA.SYSTEM_INDEXINFO "+
- "WHERE table_schem='PUBLIC' AND TABLE_NAME=? ORDER BY index_name,ordinal_position ASC";
+ "WHERE table_schem=? AND TABLE_NAME=? ORDER BY index_name,ordinal_position ASC";
List list = new ArrayList();
+ list.add(schemaNameForQueries.toUpperCase());
list.add(tableName.toUpperCase());
IResultSet result = performQuery(query,list,cacheKeys,queryClass);
String lastIndexName = null;
@@ -896,7 +905,9 @@ public class DBInterfaceHSQLDB extends D
public StringSet getAllTables(StringSet cacheKeys, String queryClass)
throws ManifoldCFException
{
- IResultSet set = performQuery("SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='PUBLIC'",null,cacheKeys,queryClass);
+ ArrayList list = new ArrayList();
+ list.add(schemaNameForQueries.toUpperCase());
+ IResultSet set = performQuery("SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema=?",list,cacheKeys,queryClass);
StringSetBuffer ssb = new StringSetBuffer();
String columnName = "table_name";