python-mysql-replication icon indicating copy to clipboard operation
python-mysql-replication copied to clipboard

Replaying binlog with dropped columns causes unhandled exception.

Open vartec opened this issue 9 years ago • 2 comments

Steps to reproduce:

  1. create a table with few columns
  2. generate some row events
  3. drop a column from that table
  4. generate some more row events
  5. 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.

vartec avatar Jun 17 '15 23:06 vartec

Created a unittest to show another scenario when it is still a problem. 9549d6e7188222377345262f9cb2cd5c5da7f1c1

vartec avatar Jun 19 '15 20:06 vartec

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

jagarcia29 avatar Apr 28 '20 04:04 jagarcia29