EasyPost / rust-mysql-binlog

Rust implementation of the MySQL binlog format
ISC License
104 stars 18 forks source link

"attempt to subtract with overflow" #13

Closed zaibacu closed 2 years ago

zaibacu commented 2 years ago

I have one concrete binlog file which causes this error while trying to parse events.

It refers to this line: https://github.com/EasyPost/rust-mysql-binlog/blob/master/src/event.rs#L488

I can upload concrete binlog file, but is 100Mb :)

Roguelazer commented 2 years ago

What version of mysql was the binlog file generated with?

Based on my reading of the spec, it's either from a bizarre version of MySQL, or it's corrupted; the header should always be 19 bytes.

zaibacu commented 2 years ago

That's MariaDB 10.6.4

It may be corrupted, because there are 14 binlog files in total and only one is causing such problems

Roguelazer commented 2 years ago

If it's not confidential and you're willing to share it with me, you can drop it in my personal dropbox account at https://www.dropbox.com/request/Pc7ZcXDdd98QpUkW5b22 and I'll see if I can make the library tolerant of whatever kind of corruption this is

zaibacu commented 2 years ago

I've found out, that this is a problem from my side. I misunderstood offset parameter. Used same offset and crawled through all binlogs till I found some new records. It turns out, I need to reset offset to 0 each time new file is being parsed