Author: shawkins
Date: 2010-06-28 10:36:05 -0400 (Mon, 28 Jun 2010)
New Revision: 2307
Modified:
branches/7.0.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
Log:
TEIID-1135 fix for npe with a count query
Modified:
branches/7.0.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
===================================================================
---
branches/7.0.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-06-26
03:26:50 UTC (rev 2306)
+++
branches/7.0.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-06-28
14:36:05 UTC (rev 2307)
@@ -114,14 +114,14 @@
@Override
public void execute() throws TranslatorException {
try {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Incoming
Query: " + query.toString()); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble(), "Incoming
Query:", query); //$NON-NLS-1$
List<TableReference> from = ((Select)query).getFrom();
String finalQuery;
if(from.get(0) instanceof Join) {
visitor = new JoinQueryVisitor(metadata);
visitor.visitNode(query);
finalQuery = visitor.getQuery().trim();
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing
Query: " + finalQuery); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble(), "Executing
Query:", finalQuery); //$NON-NLS-1$
results = connection.query(finalQuery, this.context.getBatchSize(),
visitor.getQueryAll());
} else {
@@ -132,7 +132,7 @@
visitor.getTableName(), visitor.getIdInCriteria());
} else {
finalQuery = visitor.getQuery().trim();
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing
Query: " + finalQuery); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble(), "Executing
Query:", finalQuery); //$NON-NLS-1$
results = connection.query(finalQuery, this.context.getBatchSize(),
visitor.getQueryAll());
}
}
@@ -147,6 +147,9 @@
List<?> result;
if (query.getProjectedQuery().getDerivedColumns().get(0)
.getExpression() instanceof AggregateFunction) {
+ if (results == null) {
+ return null;
+ }
result = Arrays.asList(results.getSize());
results = null;
Show replies by date