Bug #61073 duplicate table map IDs from RBR and multi-table delete
Submitted: 5 May 2011 17:43 Modified: 13 May 2011 16:15
Reporter: Mark Callaghan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1.52 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any
Tags: delete, multi, RBR, table

[5 May 2011 17:43] Mark Callaghan
Description:
This appears to have been by 5.1.56. I did not check 5.1.5[345]. However, I also did not see anything in the release notes to describe that the problem has been fixed.

Was this fixed on purpose and if yes, what is the bug number?
Is there an mtr regression test for it now?

The basic problem is that for a statement like the following, the table map events use the same ID in 5.1.52 and that makes the slave halt as it tries to delete a row that doesn't exist from the wrong table.

delete userstats, userstats2 from userstats inner join userstats2 where userstats.i = userstats2.i;

binlog dump from 5.1.52:

#110505 10:22:25 server id 1  end_log_pos 1957 	Table_map: `test`.`userstats` mapped to number 0
#110505 10:22:25 server id 1  end_log_pos 2007 	Table_map: `test`.`userstats2` mapped to number 0

binlog dump from 5.1.56

#110505 10:41:46 server id 1  end_log_pos 1957 	Table_map: `test`.`userstats` mapped to number 24
#110505 10:41:46 server id 1  end_log_pos 2007 	Table_map: `test`.`userstats2` mapped to number 26

How to repeat:
na

Suggested fix:
na
[5 May 2011 17:45] Mark Callaghan
repro case

Attachment: rpl_brow.test (application/octet-stream, text), 1.94 KiB.

[5 May 2011 17:45] Mark Callaghan
mysqlbinlog output from master

Attachment: o.binlog (application/octet-stream, text), 6.80 KiB.

[5 May 2011 17:46] Mark Callaghan
mysql-test-run output from failure

Attachment: o.mtr (application/octet-stream, text), 18.46 KiB.

[5 May 2011 17:46] Mark Callaghan
From the slave error log

110505 20:39:52 [ERROR] Slave SQL: Could not execute Delete_rows event on table test.userstats; Can't find record in 'userstats', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 2054, Error_cod
e: 1032
110505 20:39:52 [Warning] Slave: Can't find record in 'userstats' Error_code: 1032
110505 20:39:52 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'master-bin.000001' position 1840
CURRENT_TEST: rpl.rpl_brow
[5 May 2011 19:00] Sveta Smirnova
Thank you for the report.

You are correct. This change was introduced in version 5.1.53 and never reflected in change logs and other documentation.

So setting bug to "Verified". Probably "Documentation" is better category.
[10 May 2011 15:59] Sveta Smirnova
This was fixed by fix of bug #56226 in version 5.1.53. Moving category to "Documentation" so it will be reflected in user manual.
[13 May 2011 16:15] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.