mysql-binlog-connector-java
mysql-binlog-connector-java copied to clipboard
Incorrect SQL statement resolved
MySQL 5.6.42 binlog
SQL statement resolved by BinaryLogFileReader is incorrect:
"BEGINv���" = queryEventData.getSql()
mysqlbinlog -H mysql-6-bin.000001
# at 11435
#190917 6:50:08 server id 1000 end_log_pos 11516 CRC32 0xd2839676
# Position Timestamp Type Master ID Size Master Pos Flags
# 2cab 20 82 80 5d 02 e8 03 00 00 51 00 00 00 fc 2c 00 00 08 00
# 2cbe 71 00 00 00 00 00 00 00 05 00 00 22 00 00 00 00 |q...............|
# 2cce 00 00 01 00 00 20 40 00 00 00 00 06 03 73 74 64 |.............std|
# 2cde 04 2d 00 2d 00 e0 00 0c 01 73 63 6f 74 74 00 73 |.........scott.s|
# 2cee 63 6f 74 74 00 42 45 47 49 4e 76 96 83 d2 |cott.BEGINv...|
# Query thread_id=113 exec_time=0 error_code=0
SET TIMESTAMP=1568703008/*!*/;
BEGIN
/*!*/;
mysqlbinlog can resolve the SQL correctly.
It works when put eventDeserializer.setChecksumType(ChecksumType.CRC32) if reading binlog file of v5.6.2+.