danfengcao / binlog2sql

Parse MySQL binlog to SQL you want

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IndexError: list index out of range

kalaGN opened this issue · comments

commented

使用命令
python binlog2sql.py -h112.3.9.17 -uxxx -pxxx -dcommon --start-file=mysql-bin.000012 --start-datetime='2021-06-09 00:00:00' --stop-datetime='2021-06-10 00:00:00'

打印两条sql后报错

Traceback (most recent call last):
File "binlog2sql.py", line 150, in
binlog2sql.process_binlog()
File "binlog2sql.py", line 105, in process_binlog
for row in binlog_event.rows:
File "/usr/lib/python2.7/site-packages/pymysqlreplication/row_event.py", line 428, in rows
self._fetch_rows()
File "/usr/lib/python2.7/site-packages/pymysqlreplication/row_event.py", line 423, in _fetch_rows
self.__rows.append(self._fetch_one_row())
File "/usr/lib/python2.7/site-packages/pymysqlreplication/row_event.py", line 476, in _fetch_one_row
row["values"] = self._read_column_data(self.columns_present_bitmap)
File "/usr/lib/python2.7/site-packages/pymysqlreplication/row_event.py", line 165, in _read_column_data
self.packet.read_uint_by_size(column.size) - 1]
IndexError: list index out of range

用 python3 试试