in core/lib/payload/copy.py [0:0]
def dump_current_chunk(self, use_where):
"""
Use select into outfile to dump the data in the previous chunk that
caused checksum mismatch
@param use_where: whether we should use session variable as selection
boundary in where condition
@type use_where: bool
"""
log.info("Dumping raw data onto local disk for further investigation")
log.info("Columns will be dumped in following order: ")
log.info(", ".join(self._pk_for_filter + self.checksum_column_list))
for table_name in [self.table_name, self.new_table_name]:
if table_name == self.new_table_name:
# index for new scehma can be any indexes that provides
# uniqueness and covering old PK lookup
idx_for_checksum = self.find_coverage_index()
outfile = "{}.new".format(self.outfile)
else:
# index for old schema should always be PK
idx_for_checksum = "PRIMARY"
outfile = "{}.old".format(self.outfile)
log.info("Dump offending chunk from {} into {}".format(table_name, outfile))
self.execute_sql(
sql.dump_current_chunk(
table_name,
self.checksum_column_list,
self._pk_for_filter,
self.range_start_vars_array,
self.select_chunk_size,
idx_for_checksum,
use_where,
),
(outfile,),
)