Skip to content

Commit

Permalink
Merge pull request #99 from assimbly/229-sqldouble-insert-of-backslas…
Browse files Browse the repository at this point in the history
…h-if-option-escape-characters-is-enabled

Sql - query was interpolated 2 times
  • Loading branch information
skin27 authored Jun 18, 2024
2 parents 8b57e06 + 4325168 commit 6ba3b44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions sql/src/main/java/org/assimbly/sql/SqlConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ public String getDatabase(Exchange exchange) {
return interpolateVar(database, exchange);
}

public String getQuery(Exchange exchange) {
String query = Base64Helper.unmarshal(this.query, StandardCharsets.UTF_8);
return interpolateVar(query, exchange);
public String getQuery() {
return Base64Helper.unmarshal(this.query, StandardCharsets.UTF_8);
}

public ConnectionType getConnectionType() {
Expand Down
2 changes: 1 addition & 1 deletion sql/src/main/java/org/assimbly/sql/SqlProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void process(Exchange exchange) throws Exception {
if(connection == null)
throw new SQLException("Could not connect to the database, check your settings.");

Document result = executeQuery(exchange, connection, config.getQuery(exchange).trim());
Document result = executeQuery(exchange, connection, config.getQuery().trim());

exchange.getIn().setBody(XmlHelper.prettyPrint(result));
}
Expand Down

0 comments on commit 6ba3b44

Please sign in to comment.