[FLINK-40340] Fix schema change exception when parsing MySQL zerofill data types without unsigned keyword - #4500
Conversation
f7e44e1 to
5402772
Compare
5402772 to
09174da
Compare
yuxiqian
left a comment
There was a problem hiding this comment.
Nice catch! Could you please add corresponding data types into MySqlFullTypesITCase?
|
Hi @Jzjsnow, just a friendly follow-up when you have a chance. Are there any updates on this? Thanks for your time! |
… data types without unsigned keyword
09174da to
0c19364
Compare
Thanks for the suggestion! I have added the corresponding data types to MySqlFullTypesITCase. Here’s a clarification: even if the The actual cause of the failure is that the schema change DDL was generated during the incremental phase and processed without the |
0c19364 to
e14a5d6
Compare
What is the purpose of this pull request?
MySQL allows declaring numeric columns with
ZEROFILLalone (e.g.INT ZEROFILL),which implicitly implies
UNSIGNED.MySqlTypeUtilspreviously only recognized<TYPE> UNSIGNED ZEROFILLand threwUnsupportedOperationExceptionfor bare<TYPE> ZEROFILL, breaking schema evolution for such tables.This PR adds explicit
<TYPE> ZEROFILLconstants and mapping branches that mirrorthe existing
UNSIGNED ZEROFILLmappings, so ZEROFILL-only columns are convertedto the same Flink type as their
UNSIGNED ZEROFILLcounterparts.Brief change log
Add
<TYPE> ZEROFILLconstants for all numeric types inflink-connector-mysql-cdc/flink-cdc-pipeline-connector-mysqlMySqlTypeUtils:TINYINT,SMALLINT,MEDIUMINT,INT,INTEGER,BIGINT,REAL,FLOAT,DOUBLE,DOUBLE PRECISION,NUMERIC,FIXED,DECIMAL.Add unit tests in
MySqlTypeUtilsTestcovering ZEROFILL type mappings for all numeric typesVerifying this change
This change added tests and can be verified as follows:
MySqlTypeUtilsTestDocumentation
Was generative AI tooling used to co-author this PR?