You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "sandynz (via GitHub)" <gi...@apache.org> on 2026/04/16 05:56:36 UTC
[PR] Pipeline: Fix MySQL datetime(4) zero-value binlog decoding in migration [shardingsphere]
sandynz opened a new pull request, #38629:
URL: https://github.com/apache/shardingsphere/pull/38629
Fixes #35531.
Changes proposed in this pull request:
- Pipeline: Fix MySQL datetime(4) zero-value binlog decoding in migration
---
Before committing this PR, I'm sure that I have checked the following options:
- [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [ ] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the pull request.
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [ ] I have made corresponding changes to the documentation.
- [ ] I have added corresponding unit tests for my changes.
- [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Pipeline: Fix MySQL datetime(4) zero-value binlog decoding in migration [shardingsphere]
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz merged PR #38629:
URL: https://github.com/apache/shardingsphere/pull/38629
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Pipeline: Fix MySQL datetime(4) zero-value binlog decoding in migration [shardingsphere]
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on PR #38629:
URL: https://github.com/apache/shardingsphere/pull/38629#issuecomment-4258487272
## Scope
This PR fixes the binlog decoding misalignment for zero-value `datetime(4)` during MySQL migration incremental stage.
The root cause is that `DATETIME2` returned early on the zero-value branch and skipped consuming the fractional bytes required by `datetime(4)`, which misaligned decoding for following columns and subsequent events.
## Main Changes
- Fixed `MySQLDatetime2BinlogProtocolValue` so the zero-value branch still consumes fractional bytes according to `columnMeta`.
- Added regression unit tests for zero-value `DATETIME2` with fractional precision.
- Updated `MySQLTimeTypesMigrationE2EIT` so the E2E reliably hits this scenario.
## E2E Validation Improvement
The E2E path was tightened so the same test can clearly distinguish behavior before and after the fix:
- It explicitly waits for `EXECUTE_INCREMENTAL_TASK` before inserting the second row, so the second row does not fall into inventory stage.
- A trailing `date` column is placed after `t_datetime_4`, so missing fractional-byte consumption immediately breaks decoding of the following column.
- The inventory row writes `t_datetime_4 = NULL`, while the incremental row hits the `datetime(4)` zero default, avoiding an earlier interruption caused by inventory JDBC converting zero datetime to `null`.
With this adjustment:
- On the reverted state, the same `MySQLTimeTypesMigrationE2EIT` reliably reproduces the incremental decode failure.
- After restoring the fix, the same `MySQLTimeTypesMigrationE2EIT` passes and completes `DATA_MATCH` verification.
## Verification
- `./mvnw -pl database/protocol/dialect/mysql -Dtest=MySQLDatetime2BinlogProtocolValueTest,MySQLFractionalSecondsTest test -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dspotless.skip=true -Dcheckstyle.skip=true`
- Exit code: 0
- `./mvnw -pl database/protocol/dialect/mysql -DskipTests -Pcheck -Dspotless.skip=true checkstyle:check`
- Exit code: 0
- `./mvnw -pl test/e2e/operation/pipeline -DskipTests -Pcheck -Dspotless.skip=true checkstyle:check`
- Exit code: 0
- `./mvnw -pl test/e2e/operation/pipeline -Dtest=MySQLTimeTypesMigrationE2EIT test -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dspotless.skip=true -Dcheckstyle.skip=true`
- Reverted state: Exit code 1
- Fixed state: Exit code 0
## Notes
- Runtime validation was performed in NATIVE mode with an external `proxy/bootstrap/.../Bootstrap.java`.
- The fix scope stays limited to `DATETIME2`, matching the reported issue, and does not extend to `TIMESTAMP2` / `TIME2`.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org