From b664c08c15da49d4e32b4a28f609ecf133dfc50e Mon Sep 17 00:00:00 2001 From: ligang Date: Tue, 28 May 2019 15:10:51 +0800 Subject: [PATCH] update getSqlAndSqlParamsMap in order to replace title --- .../java/cn/escheduler/server/worker/task/sql/SqlTask.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java b/escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java index 89822e710c..3e85b55b91 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java @@ -189,6 +189,12 @@ public class SqlTask extends AbstractTask { return new SqlBinds(sqlBuilder.toString(), sqlParamsMap); } + if (StringUtils.isNotEmpty(sqlParameters.getTitle())){ + String title = ParameterUtils.convertParameterPlaceholders(sqlParameters.getTitle(), ParamUtils.convert(paramsMap)); + logger.info(title); + sqlParameters.setTitle(title); + } + // special characters need to be escaped, ${} needs to be escaped String rgex = "'?\\$\\{(.*?)\\}'?"; setSqlParamsMap(sql,rgex,sqlParamsMap,paramsMap);