• unknown's avatar
    Bug#17877 - Corrupted spatial index · 02edab28
    unknown authored
    CHECK TABLE could complain about a fully intact spatial index.
    A wrong comparison operator was used for table checking. 
    The result was that it checked for non-matching spatial keys. 
    This succeeded if at least two different keys were present, 
    but failed if only the matching key was present.
    
    I fixed the key comparison.
    
    
    myisam/mi_check.c:
      Bug#17877 - Corrupted spatial index
      Fixed the comparison operator for checking a spatial index.
      Using MBR_EQUAL | MBR_DATA to compare for equality and
      include the data pointer in the comparison. The latter
      finds the index entry that points to the current record.
      This is necessary for non-unique indexes.
      
      The old operator, SEARCH_SAME, is unknown to the rtree
      search functions and handled like MBR_DISJOINT.
    myisam/mi_key.c:
      Bug#17877 - Corrupted spatial index
      Added a missing DBUG_RETURN.
    myisam/rt_index.c:
      Bug#17877 - Corrupted spatial index
      Included the data pointer in the copy of the search key.
      This is necessary for searching the index entry that points
      to a specific record if the search_flag contains MBR_DATA.
    myisam/rt_mbr.c:
      Bug#17877 - Corrupted spatial index
      Extended the RT_CMP() macro with an assert for an 
      unexpected comparison operator.
    mysql-test/r/gis-rtree.result:
      Bug#17877 - Corrupted spatial index
      The test result.
    mysql-test/t/gis-rtree.test:
      Bug#17877 - Corrupted spatial index
      The test case.
    02edab28
mi_key.c 13.7 KB