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

Bug #1347392 reported by William Shallum
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Data Dumper
Fix Released
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

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.