• unknown's avatar
    Fix for bug #28837: MyISAM storage engine error (134) doing delete with · 67bf39f2
    unknown authored
    self-join
    
    When doing DELETE with self-join on a MyISAM or MERGE table, it could
    happen that a record being retrieved in join_read_next_same() has
    already been deleted by previous iterations. That caused the engine's
    index_next_same() method to fail with HA_ERR_RECORD_DELETED error and
    the whole DELETE query to be aborted with an error.
    
    Fixed by suppressing the HA_ERR_RECORD_DELETED error in
    hy_myisam::index_next_same() and ha_myisammrg::index_next_same(). Since
    HA_ERR_RECORD_DELETED can only be returned by MyISAM, there is no point
    in filtering this error in the SQL layer.
    
    
    mysql-test/r/merge.result:
      Added a test case for bug #28837.
    mysql-test/r/myisam.result:
      Added a test case for bug #28837.
    mysql-test/t/merge.test:
      Added a test case for bug #28837.
    mysql-test/t/myisam.test:
      Added a test case for bug #28837.
    sql/ha_myisam.cc:
      Skip HA_ERR_RECORD_DELETED silently when calling mi_rnext_same().
    sql/ha_myisammrg.cc:
      Skip HA_ERR_RECORD_DELETED silently when calling mi_rnext_same().
    67bf39f2
myisam.result 65.7 KB