Skip to content

Commit

Permalink
Fix missing some data when begin query event is occurred after batch_…
Browse files Browse the repository at this point in the history
…replica_size is reached

rel-issue:the4thdoctor#111
  • Loading branch information
JasonLiu1567 committed Jun 13, 2024
1 parent 50ed941 commit ea3c4ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pg_chameleon/lib/mysql_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,9 @@ def __read_replica_stream(self, batch_data):

sql_tokeniser.reset_lists()
if close_batch:
if len(group_insert) > 0:
self.logger.debug("writing the remaining %s row events when the statement event occurs" % (len(group_insert),))
self.pg_engine.write_batch(group_insert)
my_stream.close()
return [master_data, close_batch]
else:
Expand Down

0 comments on commit ea3c4ae

Please sign in to comment.