Open EvgeniyKirr opened 1 year ago
Thanks for reporting, can you check the output of official mysqlbinlog? maybe it's a limitation of binlog protocol
Thanks for the reply. Here is the mysqlbinlog output. It really looks like it's mysql's troubles, although the correct values are also written
#230216 16:54:10 server id 2 end_log_pos 31101420 CRC32 0x1dc40ad2 Write_rows: table id 973 flags: STMT_END_F
BINLOG '
gjXuYxMCAAAARQAAALaR2gEAAM0DAAAAAAEACmxpdmVtYXN0ZXIADXVuc2lnbmVkX3Rlc3QABQgD
CQIBAAABAfihx/FO
gjXuYx4CAAAANgAAAOyR2gEAAM0DAAAAAAEAAgAF/wD//4ldeEVjgf/g9YUfoYfogMjSCsQd
'/*!*/;
### INSERT INTO `test`.`unsigned_test`
### SET
### @1=-9123372036854775809 (9323372036854775807)
### @2=-2047483649 (2247483647)
### @3=-7888609 (8888607)
### @4=-32536 (33000)
### @5=-56 (200)
# at 31101420
#230216 16:54:10 server id 2 end_log_pos 31101451 CRC32 0x5a77dd3c Xid = 8094968
COMMIT/*!*/;
# at 31101451
How did you solve this problem?
The MySQL binary log does not contain sign information, this is why the output from mysqlbinlog
shows two numbers, one where the bytes are interpreted as a signed number, and one where they are interpreted as an unsigned number. It is up to this code to get DDL information to know how to interpret those values correctly.
200 - 256 = -56 33000 - 65536 = -32536 etc
github.com/go-mysql-org/go-mysql v1.7.0 mysql version: 8.0.19-10
Values are corrupted
9323372036854775807 -> -9123372036854775809 2247483647 -> -2047483649 8888607 -> -7888609 33000 -> -32536 200 -> -56