Flink CDC Issue Import created FLINK-34817:
----------------------------------------------
Summary: [Bug] Can't map utf8mb4 given for characterSetResults to
a supported MySQL encoding
Key: FLINK-34817
URL: https://issues.apache.org/jira/browse/FLINK-34817
Project: Flink
Issue Type: Bug
Components: Flink CDC
Reporter: Flink CDC Issue Import
### Search before asking
- [X] I searched in the
[issues|https://github.com/ververica/flink-cdc-connectors/issues) and found
nothing similar.
### Flink version
flink:1.13.6
### Flink CDC version
flinkcdc:2.2.1
### Database and its version
DataBase: mysql 8.x
### Minimal reproduce step
When using Flinkcdc to collect MySQL, the fields in the MySQL table contain
emoji emojis. If Flinkcdc is directly used to collect MySQL, emoji will become
????.
Therefore, jdbcProperty. setProperty ("characterSetResults", "utf8mb4") has
been set;
However, the following error was reported:
Caused by: com.mysql.cj.exceptions.WrongArgumentException: Can't map UTF8mb4
given for characterSetResults to a supported MySQL encoding.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at
com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at
com.mysql.cj.NativeSession.configureClientCharacterSet(NativeSession.java:561)
at
com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1316)
at
com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:967)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)
... 50 more
### What did you expect to see?
I hope that by setting jdbcProperty. setProperty ("characterSetResults",
"utf8mb4"), emoji can be collected normally
### What did you see instead?
Caused by: com.mysql.cj.exceptions.WrongArgumentException: Can't map UTF8mb4
given for characterSetResults to a supported MySQL encoding.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at
com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at
com.mysql.cj.NativeSession.configureClientCharacterSet(NativeSession.java:561)
at
com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1316)
at
com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:967)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826]
... 50 more
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
---------------- Imported from GitHub ----------------
Url: https://github.com/apache/flink-cdc/issues/2518
Created by: [gujincheng|https://github.com/gujincheng]
Labels: bug,
Created at: Fri Sep 22 16:25:38 CST 2023
State: open
--
This message was sent by Atlassian Jira
(v8.20.10#820010)