go-mysql/client Execute method blocks

Viewed 28

I want to run a sql statement like show BINLOG events in 'mysql-bin.000004' from 4 limit 1; using go-mysql/client's Execute method.

If the statement executes with no error, it works fine.

However, if I use a wrong event pos in the statement, like show BINLOG events in 'mysql-bin.000004' from 5 limit 1; (I will receive Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error when I execute it in console), the method blocks.

Does anyone know why?

1 Answers

The offset is a file offset of the binary log event. As no binary log event is 1 byte long, if position 4 is valid 5 will be invalid.

The binary log events position increments by the length of the previous event.

Related