fix: 校验数据库名称
This commit is contained in:
parent
213b2b4d71
commit
00a3da756e
@ -781,7 +781,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
|||||||
case StarRocks:
|
case StarRocks:
|
||||||
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
|
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
|
||||||
mysqlConfiguration.getJdbc();
|
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");
|
throw new Exception("Invalid database name");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user