Bug #60079 dict_load_table_on_id() can scan too many records
Submitted: 10 Feb 2011 9:00 Modified: 15 Oct 2012 13:52
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: Marko Mäkelä CPU Architecture:Any
Tags: data dictionary, DDL, innodb

[10 Feb 2011 9:00] Marko Mäkelä
Description:
This was introduced in the fix of Bug #53756.

When dict_load_table_on_id() encounters a delete-marked record in ID_IND (SYS_TABLES.ID), it will keep advancing to the next record until a record is found that it is not delete-marked. Because the index is ordered by ID, it could and should terminate this scan when a non-matching ID is found.

How to repeat:
Read the code.

Suggested fix:
Only check the delete-mark flag for records whose ID matches table_id.
[10 Feb 2011 9:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/130978
[10 Feb 2011 9:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/130979
[15 Oct 2012 13:52] Erlend Dahl
Fixed in 5.6.2