[ 
https://issues.apache.org/jira/browse/FLINK-39916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yanquan Lv resolved FLINK-39916.
--------------------------------
    Fix Version/s: cdc-3.7.0
         Assignee: XiaodongHuan
       Resolution: Fixed

Fixed in master via 6914d70283d43028676b6116413aaf360dc9214a

> Incorrect placeholder used in MySqlDataSourceFactory exception message
> ----------------------------------------------------------------------
>
>                 Key: FLINK-39916
>                 URL: https://issues.apache.org/jira/browse/FLINK-39916
>             Project: Flink
>          Issue Type: Bug
>          Components: Flink CDC
>    Affects Versions: cdc-3.5.0
>            Reporter: XiaodongHuan
>            Assignee: XiaodongHuan
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: cdc-3.7.0
>
>
> *Description*
> In `MySqlDataSourceFactory`, the exception uses `{}` as a placeholder inside 
> `String.format(...)`.
> However, `String.format(...)` only supports Java formatter placeholders such 
> as `%s`. The `{}` placeholder will not be replaced.
> *Current Code*
> {code:java}
> throw new IllegalArgumentException(
>         String.format(
>                 "Only \"snapshot\" of MySQLDataSource StartupOption is 
> supported in BATCH pipeline, but actual MySQLDataSource StartupOption is {}.",
>                 startupOptions.startupMode)); {code}
> h2. Expected Behavior
> The actual startup mode should be included in the exception.
> h2. Suggested Fix
> Replace {{{}}} with \{{{}%s{}}}.
> h2. Additional Cleanup
> The same file also contains an unused constant:
> {code:java}
> private static final String DOT_PLACEHOLDER = "$dot_placeholder$";{code}
> This constant is not referenced anywhere in {{MySqlDataSourceFactory}} and 
> can be safely removed as part of the same small cleanup.
> h2. File
> {{flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/src/main/java/org/apache/flink/cdc/connectors/mysql/factory/MySqlDataSourceFactory.java}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to