• Raghav Kapoor's avatar
    BUG#17665767 - FAILING ASSERTION: PRIMARY_KEY_NO == -1 || PRIMARY_KEY_NO == 0 · cdf72d51
    Raghav Kapoor authored
    BACKGROUND:
    This bug is a followup on Bug#16368875.
    The assertion failure happens because in SQL layer the key
    does not get promoted to PRIMARY KEY but InnoDB takes it
    as PRIMARY KEY.
    
    ANALYSIS:
    Here we are trying to create an index on POINT (GEOMETRY)
    data type which is a type of BLOB (since GEOMETRY is a
    subclass of BLOB).
    In general, we can't create an index over GEOMETRY family
    type field unless we specify the length of the
    keypart (similar to BLOB fields).
    Only exception is the POINT field type. The POINT column
    max size is 25. The problem is that the field is not treated
    as PRIMARY KEY when we create a index on POINT column using
    its max column size as key part prefix. The fix would allow
    index on POINT column to be treated as PRIMARY KEY.
    
    FIX:
    Patch for Bug#16368875 is extended to take into account
    GEOMETRY datatype, POINT in particular to consider it
    as PRIMARY KEY in SQL layer.
    cdf72d51
sql_yacc.yy 438 KB