diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java index 2b5f117613..7d1b424ea9 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java @@ -411,6 +411,9 @@ public boolean hasRelationShip(Integer id) { @Override public Table getTable(Integer id, String schemaName, String tableName) { + if (Asserts.isNullString(tableName)) { + return null; + } DataBase dataBase = getById(id); Asserts.checkNotNull(dataBase, Status.DATASOURCE_NOT_EXIST.getMessage()); try (Driver driver = Driver.build(dataBase.getDriverConfig())) { diff --git a/dinky-cdc/dinky-cdc-core/src/main/java/org/dinky/cdc/mysql/MysqlCDCBuilder.java b/dinky-cdc/dinky-cdc-core/src/main/java/org/dinky/cdc/mysql/MysqlCDCBuilder.java index 1014ae4219..f9b8d2ff4a 100644 --- a/dinky-cdc/dinky-cdc-core/src/main/java/org/dinky/cdc/mysql/MysqlCDCBuilder.java +++ b/dinky-cdc/dinky-cdc-core/src/main/java/org/dinky/cdc/mysql/MysqlCDCBuilder.java @@ -215,16 +215,9 @@ public DataStreamSource build(StreamExecutionEnvironment env) { @Override public Map parseMetaDataConfig() { - boolean tinyInt1isBit = !config.getJdbc().containsKey("tinyInt1isBit") - || "true".equalsIgnoreCase(config.getJdbc().get("tinyInt1isBit")); - boolean transformedBitIsBoolean = !config.getJdbc().containsKey("transformedBitIsBoolean") - || "true".equalsIgnoreCase(config.getJdbc().get("transformedBitIsBoolean")); - String url = String.format("jdbc:mysql://%s:%d/", config.getHostname(), config.getPort()); - if (tinyInt1isBit && transformedBitIsBoolean) { - url += "?tinyInt1isBit=true"; - } else { - url += "?tinyInt1isBit=false"; - } + String url = String.format( + "jdbc:mysql://%s:%d/%s", + config.getHostname(), config.getPort(), composeJdbcProperties(config.getJdbc())); return parseMetaDataSingleConfig(url); } @@ -250,6 +243,7 @@ protected String generateUrl(String schema) { config.getHostname(), config.getPort(), schema, composeJdbcProperties(config.getJdbc())); } + // Append jdbc properties, such as: ?tinyInt1isBit=true&useSSL=true private String composeJdbcProperties(Map jdbcProperties) { if (jdbcProperties == null || jdbcProperties.isEmpty()) { return "";