• unknown's avatar
    Fix for bug #22364 "Inconsistent "matched rows" when executing UPDATE" · 4e582a30
    unknown authored
    In multi_update::send_data(), the counter of matched rows was not correctly incremented, when during insertion of a new row to a temporay table it had to be converted from HEAP to MyISAM.
    
    This fix changes the logic to increment the counter of matched rows in the following cases:
    1. If the error returned from write_row() is zero.
    2. If the error returned from write_row() is non-zero, is neither HA_ERR_FOUND_DUPP_KEY nor HA_ERR_FOUND_DUPP_UNIQUE, and a call to create_myisam_from_heap() succeeds. 
    
    
    mysql-test/r/update.result:
      Added a test case for bug #22364 "Inconsistent "matched rows" when executing UPDATE"
    mysql-test/t/update.test:
      Added a test case for bug #22364 "Inconsistent "matched rows" when executing UPDATE"
    sql/sql_update.cc:
      In multi_update::send_data(), the counter of matched rows was not correctly incremented, when during insertion of a new row to a temporay table it had to be converted from HEAP to MyISAM.
      
      This fix changes the logic to increment the counter of matched rows in the following cases:
      1. If the error returned from write_row() is zero.
      2. If the error returned from write_row() is non-zero, is neither HA_ERR_FOUND_DUPP_KEY nor HA_ERR_FOUND_DUPP_UNIQUE, and a call to create_myisam_from_heap() succeeds.
    4e582a30
update.test 12.4 KB