From bc5f317f1550c5ef996e8189c422d4969dc1f1c6 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 4 Feb 2021 17:07:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20SQL=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E6=95=B0=E6=8D=AE=E6=BA=90=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/service/HistoricalDataUpgradeService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java b/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java index e18a717805..0033018d34 100644 --- a/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java +++ b/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java @@ -178,7 +178,9 @@ public class HistoricalDataUpgradeService { ((MsJDBCSampler) element).setDataSourceId(dto.getDatabaseConfig().getId()); ((MsJDBCSampler) element).setDataSource(dto.getDatabaseConfig()); } - ((MsJDBCSampler) element).setVariables(new ArrayList<>()); + if (CollectionUtils.isEmpty(request1.getVariables())) { + ((MsJDBCSampler) element).setVariables(new ArrayList<>()); + } element.setType("JDBCSampler"); } if (request instanceof TCPRequest) {