Timestamp時間戳精確到微妙級別,出現bug

timestamp時間戳精確到微妙級別,出現bugide

自MariaDB5.3版本起,timestamp時間戳精確到微妙級別,但這裏存在一個致命bug,它會致使binlog記錄的內容損壞,導致閃回恢復功能失效、Canal工具抓取binlog失敗。
影響版本MariaDB 5.5/10.0工具

復現:
我使用的版本爲10.0.29-MariaDB-enterprise
Binlog格式爲ROW(Mixed不存在此BUG)
blog

建立表結構,注意:timestamp(6),精確到微妙get

create table hcy(create_time timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6));同步

插入數據it

insert into hcy(create_time) values(now());io

此時咱們查看BINLOG文件,以下圖所示:
event

一、時間變成了負數。
二、Corrupted replication event was detected. 檢測到複製被損壞。
三、10.0低版本可能會形成主從同步失敗。mariadb

該bug在MariaDB 10.1版本里修復
官方確認bug地址
https://jira.mariadb.org/browse/MDEV-5377table

相關文章
相關標籤/搜索