python-mysql-replication
python-mysql-replication copied to clipboard
Replaying binlog with dropped columns causes unhandled exception.
Steps to reproduce:
- create a table with few columns
- generate some row events
- drop a column from that table
- generate some more row events
- start
pymysqlreplication
replaying the binlog from the position prior to dropping the column
ER: Working fine.
AR: Unhandled error:
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/binlogstream.py", line 262, in fetchone
self.__freeze_schema)
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/packet.py", line 98, in __init__
freeze_schema = freeze_schema)
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 550, in __init__
column_schema = self.column_schemas[i]
IndexError: list index out of range
This is partially solved by 4c48538168f4cd3239563393a29b542cc6ffcf4b, but that doesn't solve the deeper issue at hand which is how the schema for tables is obtained. Schema is always obtained from the current version of information_schema
no matter how far in the past the RowEvent processed is.
Created a unittest to show another scenario when it is still a problem. 9549d6e7188222377345262f9cb2cd5c5da7f1c1
Are there any updates on this? This is a critical issue we are experiencing as well when using the stitchdata.com MySQL tap which uses this library for binlog replication