Bug #78662 Remove the redundant field ha_innobase::m_primary_key
Submitted: 1 Oct 2015 9:41 Modified: 5 Oct 2015 13:30
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[1 Oct 2015 9:41] Marko Mäkelä
Description:
The ha_innobase field m_primary_key is redundant, because after a table is opened, it should be equal to the base class (handler) field table_share->primary_key. If a table handle is not opened, both m_primary_key and table_share will be invalid.

How to repeat:
Read the code, and ha_innobase::open() and ha_innopart::open() in particular

Suggested fix:
Remove the field ha_innobase::m_primary_key and replace its use with table_share->primary_key.
[5 Oct 2015 13:30] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.8.0 release, and here's the changelog entry:

The ha_innobase::m_primary_key field was removed. It was redundant. A
boolean predicate, TABLE_SHARE::is_missing_primary_key(), was added.
[18 Jun 2016 21:28] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0