From e4289b5c6aeb83f2930122e7ab0f5c45ee0631f2 Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 2 Dec 2019 10:28:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/__test__/app.test.ts | 2 +- src/modules/app.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/__test__/app.test.ts b/src/modules/__test__/app.test.ts index a1c15e8..9ea92be 100644 --- a/src/modules/__test__/app.test.ts +++ b/src/modules/__test__/app.test.ts @@ -15,7 +15,7 @@ test('DEC-11030 拼接url', () => { /** * test_author_alan */ -test('BI-56355 如果驱动和URL均为空,则为其他jdbc', () => { +test('BI-56355 如果数据库类型和驱动都为空,则为其他jdbc', () => { expect(getJdbcDatabaseType('', '').databaseType).toEqual('otherJDBC'); expect(getJdbcDatabaseType('mysql', '').databaseType).toEqual('mysql'); expect(getJdbcDatabaseType('', 'com.mysql.jdbc.Driver').databaseType).toEqual('mysql'); diff --git a/src/modules/app.service.ts b/src/modules/app.service.ts index 31e6ff8..706a0ab 100644 --- a/src/modules/app.service.ts +++ b/src/modules/app.service.ts @@ -59,7 +59,7 @@ export function resolveUrlInfo (url: string) { urlInfo: greenplumUrl[9], }; } - const result = url.match(/^jdbc:(oracle|mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/|;DatabaseName=)([^\\?]+)(.*)/i); + const result = url.match(/^jdbc:(oracle|mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/|;DatabaseName=)([^]+)(.*)/i); if (result) { return { host: result[5],