diff --git a/core/core-backend/src/main/java/io/dataease/commons/utils/SqlparserUtils.java b/core/core-backend/src/main/java/io/dataease/commons/utils/SqlparserUtils.java index f1e497f3ac..c0be58252b 100644 --- a/core/core-backend/src/main/java/io/dataease/commons/utils/SqlparserUtils.java +++ b/core/core-backend/src/main/java/io/dataease/commons/utils/SqlparserUtils.java @@ -50,13 +50,14 @@ public class SqlparserUtils { private final List> sysParams = new ArrayList<>(); public String handleVariableDefaultValue(String sql, String sqlVariableDetails, boolean isEdit, boolean isFromDataSet, List parameters, boolean isCross, Map dsMap, PluginManageApi pluginManage, UserFormVO userEntity) { + DatasourceSchemaDTO ds = dsMap.entrySet().iterator().next().getValue(); if (StringUtils.isEmpty(sql)) { DEException.throwException(Translator.get("i18n_sql_not_empty")); } this.userEntity = userEntity; try { this.removeSysParams = true; - removeVariables(sql, ""); + removeVariables(sql, ds.getType()); } catch (Exception e) { DEException.throwException(e); } @@ -103,7 +104,6 @@ public class SqlparserUtils { } try { - DatasourceSchemaDTO ds = dsMap.entrySet().iterator().next().getValue(); this.removeSysParams = false; sql = removeVariables(sql, ds.getType()); // replace keyword '`'