MCPcopy Index your code
hub / github.com/danfengcao/binlog2sql / print_rollback_sql

Method print_rollback_sql

binlog2sql/binlog2sql.py:124–136  ·  view source on GitHub ↗

print rollback sql from tmp_file

(self, filename)

Source from the content-addressed store, hash-verified

122 return True
123
124 def print_rollback_sql(self, filename):
125 """print rollback sql from tmp_file"""
126 with open(filename, "rb") as f_tmp:
127 batch_size = 1000
128 i = 0
129 for line in reversed_lines(f_tmp):
130 print(line.rstrip())
131 if i >= batch_size:
132 i = 0
133 if self.back_interval:
134 print('SELECT SLEEP(%s);' % self.back_interval)
135 else:
136 i += 1
137
138 def __del__(self):
139 pass

Callers 1

process_binlogMethod · 0.95

Calls 1

reversed_linesFunction · 0.90

Tested by

no test coverage detected