You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "azexcy (via GitHub)" <gi...@apache.org> on 2024/02/18 10:32:17 UTC
[PR] Fix binlog protocol parse of zero time with fractional seconds [shardingsphere]
azexcy opened a new pull request, #30178:
URL: https://github.com/apache/shardingsphere/pull/30178
According to doc https://mariadb.com/kb/en/rows_event_v1v2-rows_compressed_event_v1/, if the fractional part not null, it's need to be parsed event if is zero time.
Changes proposed in this pull request:
- Fix binlog protocol parse of zero time with fractional seconds
- Add E2E and IT
---
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.
--
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] Fix binlog protocol parse of zero time with fractional seconds [shardingsphere]
Posted by "azexcy (via GitHub)" <gi...@apache.org>.
azexcy closed pull request #30178: Fix binlog protocol parse of zero time with fractional seconds
URL: https://github.com/apache/shardingsphere/pull/30178
--
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] Fix binlog protocol parse of zero time with fractional seconds [shardingsphere]
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on code in PR #30178:
URL: https://github.com/apache/shardingsphere/pull/30178#discussion_r1493985192
##########
test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java:
##########
@@ -84,6 +84,9 @@ void assertMigrationSuccess(final PipelineTestParameter testParam) throws SQLExc
new E2EIncrementalTask(containerComposer.getSourceDataSource(), SOURCE_TABLE_NAME, new SnowflakeKeyGenerateAlgorithm(), containerComposer.getDatabaseType(), 30));
TimeUnit.SECONDS.timedJoin(containerComposer.getIncreaseTaskThread(), 30);
containerComposer.sourceExecuteWithLog(String.format("INSERT INTO %s (order_id, user_id, status) VALUES (10000, 1, 'OK')", SOURCE_TABLE_NAME));
+ // TODO If the fractional seconds > 0 , query from JDBC will thrown Zero date value prohibited SqlTimestampValueFactory.localCreateFromDatetime, zeroDateTimeBehavior not effect
+ DataSourceExecuteUtils.execute(containerComposer.getSourceDataSource(), String.format("UPDATE %s SET t_datetime='0000-00-00 00:00:00.000000', t_timestamp='0000-00-00 00:00:00', "
+ + "t_time='00:00:00.0' WHERE order_id = 1", SOURCE_TABLE_NAME));
Review Comment:
If `0000-00-00 00:00:00.123` could not be read by MySQL JDBC driver, then it should be corrected firstly, it's not necessary to be compatible with it.
--
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] Fix binlog protocol parse of zero time with fractional seconds [shardingsphere]
Posted by "azexcy (via GitHub)" <gi...@apache.org>.
azexcy commented on PR #30178:
URL: https://github.com/apache/shardingsphere/pull/30178#issuecomment-1952198977
Close it now, Try to avoid using the time(1) type, because `00:00:00.0` is a legal value, and parsing it is currently problematic
--
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