Jzjsnow opened a new pull request, #4500:
URL: https://github.com/apache/flink-cdc/pull/4500
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## What is the purpose of this pull request?
MySQL allows declaring numeric columns with `ZEROFILL` alone (e.g. `INT
ZEROFILL`),
which implicitly implies `UNSIGNED`. `MySqlTypeUtils` previously only
recognized
`<TYPE> UNSIGNED ZEROFILL` and threw `UnsupportedOperationException` for bare
`<TYPE> ZEROFILL`, breaking schema evolution for such tables.
This PR adds explicit `<TYPE> ZEROFILL` constants and mapping branches that
mirror
the existing `UNSIGNED ZEROFILL` mappings, so ZEROFILL-only columns are
converted
to the same Flink type as their `UNSIGNED ZEROFILL` counterparts.
## Brief change log
- Add `<TYPE> ZEROFILL` constants for all numeric types in
`flink-connector-mysql-cdc`/ `flink-cdc-pipeline-connector-mysql`
`MySqlTypeUtils`:
`TINYINT`, `SMALLINT`, `MEDIUMINT`, `INT`, `INTEGER`, `BIGINT`, `REAL`,
`FLOAT`, `DOUBLE`, `DOUBLE PRECISION`, `NUMERIC`, `FIXED`, `DECIMAL`.
- Add unit tests in `MySqlTypeUtilsTest` covering ZEROFILL type mappings for
all numeric types
## Verifying this change
<!-- Describe how this change can be verified. -->
This change added tests and can be verified as follows:
- Added unit tests in `MySqlTypeUtilsTest`
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs /
not documented)
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR,
please
change the checkbox below to `[X]` followed by the name of the tool, and
uncomment the
"Generated-by" line. See the ASF Generative Tooling Guidance for details:
https://www.apache.org/legal/generative-tooling.html
You are responsible for the quality and correctness of every change in this
PR
regardless of the tooling used. Low-effort AI-generated PRs will be closed.
-->
- [ ] Yes (please specify the tool below)
<!--
Generated-by: [Tool Name and Version]
-->
--
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]