last row of table not dumped if it brings statement over statement_size

Bug #1347392 reported by William Shallum on 2014-07-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Data Dumper
Critical
Max Bubenick

Bug Description

In mydumper.c dump_table_data() if "statement->len+statement_row->len+1 > statement_size" then the statement is terminated with a ";" then written out. The data in statement_row is not written out.

The code seems to expect the next iteration of the mysql_fetch_row loop to write out the INSERT INTO statement and the data in statement_row (this is the code checking "if (statement_row->len)" near the beginning of the loop.

In the case of the last row, there is no next iteration, so the last statement_row is never written out.

Related branches

William Shallum (william) wrote :

Patch added. This checks if statement_row is not empty after the loop ends. If it is not empty it is either appended to an existing statement or a new "INSERT INTO" line.

Max Bubenick (max-bubenick) wrote :

Thanks for the report and the patch, the bug was confirmed and fix is working correctly.

Changed in mydumper:
status: New → Fix Committed
importance: Undecided → Critical
assignee: nobody → Max Bubenick (max-bubenick)
milestone: none → 0.6.2
Max Bubenick (max-bubenick) wrote :

Fix pushed to trunk, and it will be in the next release.

Changed in mydumper:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers