fix: 校验数据库名称

This commit is contained in:
taojinlong 2023-06-12 17:36:51 +08:00
parent 213b2b4d71
commit 00a3da756e

View File

@ -781,7 +781,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
case StarRocks:
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
mysqlConfiguration.getJdbc();
if(!mysqlConfiguration.getDataBase().matches("^[0-9a-zA-Z_]{1,}$")){
if(!mysqlConfiguration.getDataBase().matches("^[0-9a-zA-Z_-]{1,}$")){
throw new Exception("Invalid database name");
}
break;