mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-02 12:17:43 +08:00
[fix-5737] [Bug][Datasource] datsource other param check error (#5835)
Co-authored-by: wanggang <wanggy01@servyou.com.cn>
This commit is contained in:
parent
9ae2266cd4
commit
2df6ee1efb
@ -30,7 +30,7 @@ public abstract class AbstractDatasourceProcessor implements DatasourceProcessor
|
||||
|
||||
private static final Pattern DATABASE_PATTER = Pattern.compile("^[a-zA-Z0-9\\_\\-\\.]+$");
|
||||
|
||||
private static final Pattern PARAMS_PATTER = Pattern.compile("^[a-zA-Z0-9]+$");
|
||||
private static final Pattern PARAMS_PATTER = Pattern.compile("^[a-zA-Z0-9\\-\\_\\/]+$");
|
||||
|
||||
@Override
|
||||
public void checkDatasourceParam(BaseDataSourceParamDTO baseDataSourceParamDTO) {
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
package org.apache.dolphinscheduler.common.datasource;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.dolphinscheduler.common.datasource.mysql.MysqlConnectionParam;
|
||||
import org.apache.dolphinscheduler.common.datasource.mysql.MysqlDatasourceParamDTO;
|
||||
import org.apache.dolphinscheduler.common.datasource.mysql.MysqlDatasourceProcessor;
|
||||
@ -44,7 +46,11 @@ public class DatasourceUtilTest {
|
||||
MysqlDatasourceParamDTO mysqlDatasourceParamDTO = new MysqlDatasourceParamDTO();
|
||||
mysqlDatasourceParamDTO.setHost("localhost");
|
||||
mysqlDatasourceParamDTO.setDatabase("default");
|
||||
mysqlDatasourceParamDTO.setOther(null);
|
||||
Map<String, String> other = new HashMap<>();
|
||||
other.put("serverTimezone", "Asia/Shanghai");
|
||||
other.put("queryTimeout", "-1");
|
||||
other.put("characterEncoding", "utf8");
|
||||
mysqlDatasourceParamDTO.setOther(other);
|
||||
DatasourceUtil.checkDatasourceParam(mysqlDatasourceParamDTO);
|
||||
Assert.assertTrue(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user