From 25c9766d610f34a9effc582c884d1595728a4843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D0=B4=D0=B0=D1=80=20=D0=97=D0=B0=D0=B9?= =?UTF-8?q?=D0=BD=D1=83=D0=BB=D0=BB=D0=B8=D0=BD?= Date: Thu, 3 Oct 2024 13:46:39 +0300 Subject: [PATCH] Fixing an issue of initializing table map when fake rotate event catching for Mysql versions 5.5, 5.6, 5.7 --- pymysqlreplication/binlogstream.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymysqlreplication/binlogstream.py b/pymysqlreplication/binlogstream.py index 71eb10a2..84e0f190 100644 --- a/pymysqlreplication/binlogstream.py +++ b/pymysqlreplication/binlogstream.py @@ -554,7 +554,8 @@ def fetchone(self): # invalidates all our cached table id to schema mappings. This means we have to load them all # again for each logfile which is potentially wasted effort but we can't really do much better # without being broken in restart case - self.table_map = {} + if binlog_event.timestamp != 0: + self.table_map = {} elif binlog_event.log_pos: self.log_pos = binlog_event.log_pos