Bug #1820 Rows not deleted from second table on multi-table delete
Submitted: 12 Nov 2003 13:31 Modified: 18 Nov 2003 10:51
Reporter: Sergey Petrunia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.1-alpha OS:Linux (Linux, win32)
Assigned to: Sergey Petrunya CPU Architecture:Any

[12 Nov 2003 13:31] Sergey Petrunia
Description:
When doing multi-table delete rows from second table are not deleted if the number of rows to be deleted is big enough.

How to repeat:
Run queries like 

delete td1big,td2big from td1big,td2big 
where td1big.b=td2big.a and td1big.a < 100*1000

see the attached file for a complete test case.

Suggested fix:
Below are my guesses about the cause:
 Unique class (sql/uniques.cc) used to collect ids of rows to be deleted  returns zero rows in cases where it uses temp. files to store its data.
[12 Nov 2003 13:39] Sergey Petrunia
Test case to repeat

Attachment: test-multitable-delete.sql (text/plain), 2.31 KiB.

[13 Nov 2003 13:10] Dean Ellis
Verified in 4.1.1 from current BK tree.  Does not occur in 4.0.17.
[18 Nov 2003 10:51] Sergey Petrunya
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html