• Ramil Kalimullin's avatar
    Bug#11764487: myisam corruption with insert ignore and invalid spatial data · 768b9a0e
    Ramil Kalimullin authored
    Problem: in case of wrong data insert into indexed GEOMETRY fields 
    (e.g. NULL value for a not NULL field) MyISAM reported 
    "ERROR 126 (HY000): Incorrect key file for table; try to repair it"
    due to misuse of the key deletion function.
    
    Fix: always use R-tree key functions for R-tree based indexes
    and B-tree key functions for B-tree based indexes.
    
    
    mysql-test/r/gis-rtree.result:
      Bug#11764487: myisam corruption with insert ignore and invalid spatial data
        - test result.
    mysql-test/t/gis-rtree.test:
      Bug#11764487: myisam corruption with insert ignore and invalid spatial data
        - test case.
    storage/myisam/mi_update.c:
      Bug#11764487: myisam corruption with insert ignore and invalid spatial data
        - handling update errors check for HA_ERR_NULL_IN_SPATIAL as well to be 
      consistent with mi_write();
        - always use keyinfo->ck_delete()/ck_insert() instead of _mi_ck_delete()/_mi_ck_write()
      to handle index properly, as it may be of B-tree or R-tree type.
    storage/myisam/mi_write.c:
      Bug#11764487: myisam corruption with insert ignore and invalid spatial data
        - always use keyinfo->ck_delete() instead of _mi_ck_delete() to handle
      index properly, as it may be of B-tree or R-tree type.
    768b9a0e
gis-rtree.result 78.4 KB