thelabdude commented on a change in pull request #247:
URL: https://github.com/apache/solr/pull/247#discussion_r683537838



##########
File path: 
solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JDBCStream.java
##########
@@ -283,8 +283,9 @@ public void open() throws IOException {
       resultSet = statement.executeQuery(sqlQuery);
       resultSet.setFetchSize(fetchSize);
     } catch (SQLException e) {
-      throw new IOException(String.format(Locale.ROOT, "Failed to execute 
sqlQuery '%s' against JDBC connection '%s'.\n"
-          + e.getMessage(), sqlQuery, connectionUrl), e);
+      // don't embed the exception message in the format template as wildcard 
'%' will throw off the formatter

Review comment:
       Wait, no ... now I'm confusing myself ;-) The reason the exception 
message and not the sqlQuery was messing up the formatter is the code (before I 
changed it) was appending the exception message to the formatter template 
whereas the sqlQuery is injected as a %s parameter. I think the better fix here 
is to just inject the exception message as a %s parameter as well 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to