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 2023/04/13 02:18:08 UTC

[GitHub] [shardingsphere] azexcy commented on a diff in pull request #25144: Fix the error of incremental tasks caused by datetime containing zero value in MySQL

azexcy commented on code in PR #25144:
URL: https://github.com/apache/shardingsphere/pull/25144#discussion_r1164899700


##########
db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/time/MySQLDatetime2BinlogProtocolValue.java:
##########
@@ -48,6 +48,9 @@ private long readDatetimeV2FromPayload(final MySQLPacketPayload payload) {
     
     private Serializable readDatetime(final MySQLBinlogColumnDef columnDef, final long datetime, final MySQLPacketPayload payload) {
         long datetimeWithoutSign = datetime & (0x8000000000L - 1);
+        if (0 == datetimeWithoutSign) {
+            return MySQLTimeValueUtils.DATETIME_OF_ZERO;
+        }

Review Comment:
   The official document not find currently, but i found some relate source code from https://github.com/mysql/mysql-server/blob/5.7/sql-common/my_time.c#L1783
   
   <img width="652" alt="image" src="https://user-images.githubusercontent.com/101622833/231629876-ab01d0ec-b15d-44a5-9d85-329def80aeb9.png">
   
   the first bit sign seem not related to time 



-- 
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