• unknown's avatar
    Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it shouldn't. · ccf393b6
    unknown authored
    When the INSERT .. ON DUPLICATE KEY UPDATE has to update a matched row but
    the new data is the same as in the record then it returns as if
    no rows were inserted or updated. Nevertheless the row is silently
    updated. This leads to a situation when zero updated rows are reported 
    in the case when data has actually been changed.
    
    Now the write_record function updates a row only if new data differs from
    that in the record.
    
    
    sql/sql_insert.cc:
      Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it shouldn't.
      Now the write_record function updates a row only if new data differs from
      that in the record.
    mysql-test/r/insert_update.result:
      Added a test case for the bug#28904: INSERT .. ON DUPLICATE was silently
      updating rows when it shouldn't.
    mysql-test/t/insert_update.test:
      Added a test case for the bug#28904: INSERT .. ON DUPLICATE was silently
      updating rows when it shouldn't.
    ccf393b6
sql_insert.cc 104 KB