Skip to content

The microseconds default value of '0000-00-00 00:00:00.000000' for MySQL TIMESTAMP fields is not supported in downstream systems.#4251

Merged
lvyanquan merged 5 commits intoapache:masterfrom
yunhaoww:fixMicroSecondsDefaultValue
Mar 30, 2026
Merged

The microseconds default value of '0000-00-00 00:00:00.000000' for MySQL TIMESTAMP fields is not supported in downstream systems.#4251
lvyanquan merged 5 commits intoapache:masterfrom
yunhaoww:fixMicroSecondsDefaultValue

Conversation

@yunhaoww
Copy link
Copy Markdown
Contributor

an append for #4096

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the existing MySQL “zero timestamp” default-value compatibility handling to also cover microsecond TIMESTAMP defaults (0000-00-00 00:00:00.000000) that are rejected by downstream systems/connectors.

Changes:

  • Update invalid timestamp default conversion logic to treat values starting with 0000-00-00 00:00:00 as invalid (covers microsecond variants).
  • Add integration/unit tests for Doris, StarRocks, and Paimon connectors to validate microsecond-precision zero timestamp defaults are handled during schema application.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/test/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksMetadataApplierITCase.java Adds IT coverage for TIMESTAMP(6)/TIMESTAMP_LTZ(6) default 0000-00-00 00:00:00.000000 in create-table and add-column flows.
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksUtils.java Broadens invalid default detection from equality to prefix-match to include microsecond variants.
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-paimon/src/test/java/org/apache/flink/cdc/connectors/paimon/sink/PaimonMetadataApplierTest.java Adds test coverage for add-column with microsecond zero timestamp defaults.
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-paimon/src/main/java/org/apache/flink/cdc/connectors/paimon/sink/SchemaChangeProvider.java Broadens invalid default detection from equality to prefix-match to include microsecond variants.
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-doris/src/test/java/org/apache/flink/cdc/connectors/doris/sink/DorisMetadataApplierITCase.java Adds IT coverage for TIMESTAMP(6)/TIMESTAMP_LTZ(6) microsecond zero timestamp defaults in create-table and add-column flows (batch + streaming).
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-doris/src/main/java/org/apache/flink/cdc/connectors/doris/sink/DorisMetadataApplier.java Broadens invalid default detection from equality to prefix-match to include microsecond variants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yunhaoww
Copy link
Copy Markdown
Contributor Author

@lvyanquan Hi lvyanquan. Anything else i need to do to get the pr merged QAQ

Copy link
Copy Markdown
Contributor

@lvyanquan lvyanquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply. This change is reasonable for me, +1.

@lvyanquan lvyanquan merged commit 25a5817 into apache:master Mar 30, 2026
37 of 38 checks passed
ThorneANN pushed a commit to ThorneANN/flink-cdc that referenced this pull request Mar 31, 2026
…000000' for MySQL TIMESTAMP fields is not supported in downstream systems. (apache#4251)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants