yuxiqian commented on code in PR #3666:
URL: https://github.com/apache/flink-cdc/pull/3666#discussion_r2964441090
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/io/debezium/connector/mysql/MySqlConnection.java:
##########
@@ -769,4 +784,27 @@ public <T extends DatabaseSchema<TableId>> Object
getColumnValue(
public String quotedTableIdString(TableId tableId) {
return tableId.toQuotedString('`');
}
+
+ public String getShowBinaryLogStatement() {
+ return showBinaryLogStatement;
+ }
+
+ private String probeShowBinaryLogStatement() {
+ LOGGER.info("Probing binary log statement.");
+ try {
+ // Attempt to query
+ query(MYSQL_NEW_SHOW_BINARY_LOG_STATEMENT, rs -> {});
+ LOGGER.info(
+ "Successfully found show binary log statement with `{}`.",
+ MYSQL_NEW_SHOW_BINARY_LOG_STATEMENT);
+ return MYSQL_NEW_SHOW_BINARY_LOG_STATEMENT;
+ } catch (SQLException e) {
+ LOGGER.info(
+ "Probing with {} failed, fallback to classic {}. Caused
by: {}",
+ MYSQL_NEW_SHOW_BINARY_LOG_STATEMENT,
+ MYSQL_CLASSIC_SHOW_BINARY_LOG_STATEMENT,
+ e.getMessage());
+ return MYSQL_CLASSIC_SHOW_BINARY_LOG_STATEMENT;
Review Comment:
Such strict checking seems unnecessary, it may break on some
MySQL-compatible dialects. Falling back to legacy syntax is safer.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]