From 75561c6e8fd8573e5bb14dcc1f402887283c1b96 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 18 Nov 2024 16:37:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E8=B0=83=E8=AF=95=E6=89=A7=E8=A1=8C=E6=88=90=E5=8A=9F?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E5=AD=98=E6=8A=A5=E9=94=99=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8F=82=E6=95=B0=E4=B9=9F=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=88=90=E5=8A=9F=20#13317?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/commons/utils/SqlparserUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 0b25d9a53f..53b54bc5b8 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 @@ -507,6 +507,12 @@ public class SqlparserUtils { if (StringUtils.isEmpty(sql)) { DEException.throwException(Translator.get("i18n_sql_not_empty")); } + try { + removeVariables(sql, ""); + } catch (Exception e) { + DEException.throwException(e); + } + sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1);