julien-duponchelle / python-mysql-replication

Pure Python Implementation of MySQL replication protocol build on top of PyMYSQL
2.31k stars 678 forks source link

fake rotate event check #579

Closed sean-k1 closed 9 months ago

sean-k1 commented 9 months ago

Description

resolve #578

We initialize the table_map when we create the binlogstreamreader object.

After that, if the binlog is maxsize full, a rotateEvent is fired. At that point, we empty the table_map because the timestamp is not zero. Then, when we connect to the next binlogfile, we get a rotateEvent with a timestamp of 0. We don't need to empty the table_map again.

However, when we disconnect from mysql and reconnect, we get a fake rotateEvent with a 0 timestamp. In this case, we inform the client of error logging and do not initialize the table map.

Type of Change

Checklist

Tests

Additional Information