From bf485add69576ea72162c554378312055751d29d Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 11 Oct 2022 16:01:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20Mysql?= =?UTF-8?q?=20jdbc=E5=8F=8D=E5=BA=8F=E5=88=97=E5=8C=96=E6=BC=8F=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datasource/MysqlConfiguration.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java b/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java index 7c0378ace3..6a22b778f0 100644 --- a/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java +++ b/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java @@ -5,20 +5,30 @@ import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.StringUtils; +import java.util.Arrays; +import java.util.List; + @Getter @Setter public class MysqlConfiguration extends JdbcConfiguration { private String driver = "com.mysql.jdbc.Driver"; private String extraParams = "characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=convertToNull"; + private List illegalParameters = Arrays.asList("autoDeserialize", "queryInterceptors", "statementInterceptors", "detectCustomCollations"); public String getJdbc() { - if(StringUtils.isEmpty(extraParams.trim())){ + if (StringUtils.isEmpty(extraParams.trim())) { return "jdbc:mysql://HOSTNAME:PORT/DATABASE" .replace("HOSTNAME", getHost().trim()) .replace("PORT", getPort().toString().trim()) .replace("DATABASE", getDataBase().trim()); - }else { + } else { + for (String illegalParameter : illegalParameters) { + if (getExtraParams().contains(illegalParameter)) { + throw new RuntimeException("Illegal parameter: " + illegalParameter); + } + } + return "jdbc:mysql://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS" .replace("HOSTNAME", getHost().trim()) .replace("PORT", getPort().toString().trim()) From 9f56340dc438164a52fe27a5af20c5a4b353bb98 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 11 Oct 2022 16:29:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=E5=8D=87=E7=BA=A7=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pom.xml | 8 ++++---- frontend/package.json | 2 +- frontend/pom.xml | 2 +- mobile/package.json | 2 +- mobile/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/pom.xml b/backend/pom.xml index 160cf502c7..e637cc3138 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -6,7 +6,7 @@ dataease-server io.dataease - 1.15.0 + 1.16.0 4.0.0 @@ -205,7 +205,7 @@ io.dataease dataease-plugin-interface - 1.15.0 + 1.16.0 guava @@ -216,12 +216,12 @@ io.dataease dataease-plugin-view - 1.15.0 + 1.16.0 io.dataease dataease-plugin-datasource - 1.15.0 + 1.16.0 diff --git a/frontend/package.json b/frontend/package.json index ec13897430..70cfc979ad 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "dataease", - "version": "1.15.0", + "version": "1.16.0", "description": "dataease front", "private": true, "scripts": { diff --git a/frontend/pom.xml b/frontend/pom.xml index 633db6097d..b4c0df5188 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -6,7 +6,7 @@ dataease-server io.dataease - 1.15.0 + 1.16.0 4.0.0 diff --git a/mobile/package.json b/mobile/package.json index dbf3645e3a..7dfb130271 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -1,6 +1,6 @@ { "name": "dataease-mobile", - "version": "1.15.0", + "version": "1.16.0", "private": true, "scripts": { "serve": "npm run dev:h5", diff --git a/mobile/pom.xml b/mobile/pom.xml index c7bc8f1d80..d171907ce1 100644 --- a/mobile/pom.xml +++ b/mobile/pom.xml @@ -6,7 +6,7 @@ dataease-server io.dataease - 1.15.0 + 1.16.0 4.0.0 diff --git a/pom.xml b/pom.xml index 7797515123..2f824748d7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.dataease dataease-server - 1.15.0 + 1.16.0 pom