binlog2sql icon indicating copy to clipboard operation
binlog2sql copied to clipboard

--stop-never option has no effect

Open lfourreau opened this issue 7 years ago • 3 comments

Hi,

First thank you for your tool because it works well for my usage.

I do have a small issue with --stop-never option that doesn't seem to work because the script ends when it arrives at the end. I suppose that the expected behavior is to wait until a new event arrive in the binary log ? if so the following command grabs SQL correctly but it stop at the end :

python binlog2sql/binlog2sql.py -h X.X.X.X -u root -p --start-file mysql-bin.000001 --start-position=17024124 --stop-never

Thanks Laurent

lfourreau avatar Sep 26 '18 10:09 lfourreau

Yes, the same problem encountered

hyperknob avatar Oct 10 '18 02:10 hyperknob

Hi, pls revise the source code binlog2sqp.py , add a config 'blocking =True' when BinLogStreamReader initialzing as followings:

    stream = BinLogStreamReader(connection_settings=self.conn_setting, server_id=self.server_id,
                                log_file=self.start_file, log_pos=self.start_pos, only_schemas=self.only_schemas,
                                only_tables=self.only_tables, resume_stream=True, blocking=True)

hyperknob avatar Oct 10 '18 02:10 hyperknob

Hi, pls revise the source code binlog2sqp.py , add a config 'blocking =True' when BinLogStreamReader initialzing as followings:

    stream = BinLogStreamReader(connection_settings=self.conn_setting, server_id=self.server_id,
                                log_file=self.start_file, log_pos=self.start_pos, only_schemas=self.only_schemas,
                                only_tables=self.only_tables, resume_stream=True, blocking=True)

Thanks for figuring out the bug and fix method. I have added config blocking=True

danfengcao avatar Oct 12 '18 06:10 danfengcao