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



##########
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:
       No actually you're right, if the SQL has a %, then it will confuse the 
formatter too. This was just something I found while debugging another issue 
and it looked like it was the exception message that caused the issue but the 
sql query would too. Will escape any percents in the query / error message with 
%% and add a test case




-- 
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