Bug #53889 slaves stops with 1032; handler error HA_ERR_KEY_NOT_FOUND
Submitted: 21 May 2010 15:30 Modified: 16 Nov 2010 14:30
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S3 (Non-critical)
Version:mysql-next-mr-wl5092 OS:Any
Assigned to: Luis Soares CPU Architecture:Any

[21 May 2010 15:30] Matthias Leich
Description:
My script:
----------
--source include/master-slave.inc
--disable_abort_on_error

CREATE TABLE t2 (
col4 CHAR(25) DEFAULT NULL,
col1 BIGINT,
col2 TINYINT NOT NULL,
col5 VARCHAR(25) DEFAULT ''
) ENGINE = myisam;

ALTER TABLE t2 ADD INDEX idx1 ( col4 ) , ADD UNIQUE INDEX idx2 ( col5 );
INSERT INTO t2 ( col4 , col2 ) VALUES ( 'Hello', -77 ) ;
UPDATE t2 SET col1 = 13 WHERE col2 = -77;

--sync_slave_with_master
exit;

./mysql-test-run --mem --mysqld=--binlog-format=row rpl_ml6

Result on mysql-next-mr-wl5092
------------------------------
main.rpl_ml6                             [ fail ]
...
=== SHOW SLAVE STATUS ===
...
Last_Errno      1032
Last_Error      Could not execute Update_rows event on table test.t2; Can't find record in 't2', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 826

How to repeat:
See above
[21 May 2010 22:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/108936

3187 Luis Soares	2010-05-21
      BUG#53889: slaves stops with 1032; handler error HA_ERR_KEY_NOT_FOUND
      
      At the slave, while searching for the correct row to update, the
      index init function (ha_index_init) was initializing always the
      0th index, even if some other nth index was set to be used.
      
      We fix this by setting the correct parameter (key) when calling
      the index initialization function.
      
      Apart from fixing the bug, we also improve the index lookup
      routine to distinguish unique indexes that have null parts from
      those that don't.
     @ mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test
        Added test case.
[8 Oct 2010 13:29] Bugs System
Pushed into mysql-next-mr (revid:alexander.nozdrin@oracle.com-20101008132832-pbzewvmi9f365ak4) (version source revid:alexander.nozdrin@oracle.com-20101008132832-pbzewvmi9f365ak4) (pib:21)
[13 Nov 2010 16:09] Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:vasil.dimov@oracle.com-20100629074804-359l9m9gniauxr94) (merge vers: 5.6.99-m4) (pib:21)
[15 Nov 2010 13:10] Jon Stephens
Does this bug appear in a release version? Please advise. Thanks!
[16 Nov 2010 14:24] Luis Soares
This particular bug only existed in the feature tree. The
(faulty) behavior, however, is similar to a few bugs that
exist(ed) in RBR.

So, no, this specific bug does not appear in a released 
version.
[16 Nov 2010 14:31] Jon Stephens
Closed without further action (see comment from Luís).