Skip to content
  • Lakshmi Narayanan Sreethar's avatar
    f505633f
    Bug#21664899 · f505633f
    Lakshmi Narayanan Sreethar authored
    FAILURE CREATING COMPOSITE FKS BASED ON UNIQUE INDEXES
    
    If the child/parent index of an FK is an UniqueHashIndex, it
    has to be based on the exact same columns as that of the
    FK's child/parent columns. The column order doesn't matter.
    
    But ha_ndbcluster::find_matching_index() was returning
    UniqueHashIndexes even if there was a partial match and the
    column count didn't match up. This creates a problem during
    composite FK creation.
    
    This patch fixes it by returning UniqueHashIndexes only if
    there is a complete match - the UniqueHashIndex is based on
    the exact same columns as the FK's parent/child column list.
    This patch also includes testcases for the fix.
    f505633f
    Bug#21664899
    Lakshmi Narayanan Sreethar authored
    FAILURE CREATING COMPOSITE FKS BASED ON UNIQUE INDEXES
    
    If the child/parent index of an FK is an UniqueHashIndex, it
    has to be based on the exact same columns as that of the
    FK's child/parent columns. The column order doesn't matter.
    
    But ha_ndbcluster::find_matching_index() was returning
    UniqueHashIndexes even if there was a partial match and the
    column count didn't match up. This creates a problem during
    composite FK creation.
    
    This patch fixes it by returning UniqueHashIndexes only if
    there is a complete match - the UniqueHashIndex is based on
    the exact same columns as the FK's parent/child column list.
    This patch also includes testcases for the fix.
Loading