yuqi1129 commented on code in PR #7548: URL: https://github.com/apache/gravitino/pull/7548#discussion_r2179437462
########## catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/utils/DataSourceUtils.java: ########## @@ -76,6 +78,41 @@ private static Properties getProperties(JdbcConfig jdbcConfig) { return properties; } + private static void validateJdbcConfig(JdbcConfig jdbcConfig) { + String driver = jdbcConfig.getJdbcDriver(); + String url = jdbcConfig.getJdbcUrl(); + Map<String, String> all = jdbcConfig.getAllConfig(); + String lowerUrl = url == null ? "" : url.toLowerCase(); Review Comment: The URL cannot be null, so the check is redundant. ########## catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/utils/DataSourceUtils.java: ########## @@ -76,6 +78,41 @@ private static Properties getProperties(JdbcConfig jdbcConfig) { return properties; } + private static void validateJdbcConfig(JdbcConfig jdbcConfig) { + String driver = jdbcConfig.getJdbcDriver(); + String url = jdbcConfig.getJdbcUrl(); + Map<String, String> all = jdbcConfig.getAllConfig(); + String lowerUrl = url == null ? "" : url.toLowerCase(); + + if (driver != null && driver.toLowerCase().contains("mysql")) { + if (lowerUrl.contains("allowloadlocalinfile=true") + || containsKeyIgnoreCase(all, "allowLoadLocalInfile")) { Review Comment: Why do we need to check the key `allowLoadLocalInfile` in the `jdbcConfig`? Currently, we do not support setting `allowLoadLocalInfile` via configuration, it can only be set by `jdbc-url`. ########## catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/utils/DataSourceUtils.java: ########## @@ -76,6 +78,41 @@ private static Properties getProperties(JdbcConfig jdbcConfig) { return properties; } + private static void validateJdbcConfig(JdbcConfig jdbcConfig) { + String driver = jdbcConfig.getJdbcDriver(); + String url = jdbcConfig.getJdbcUrl(); + Map<String, String> all = jdbcConfig.getAllConfig(); + String lowerUrl = url == null ? "" : url.toLowerCase(); + + if (driver != null && driver.toLowerCase().contains("mysql")) { Review Comment: Should we need to use `lowerUrl.startsWith("jdbc:mysql")` here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@gravitino.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org