• Guilhem Bichot's avatar
    Fix for BUG#38018 INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE · 41744ed2
    Guilhem Bichot authored
    used TL_WRITE_CONCURRENT_INSERT though they may update/delete a row. This could cause concurrent SELECTs
    to see a changing table while the SELECT happens, or if the query was made of a group of SELECTs,
    some SELECTs would see different versions of the table. And anyway versioning in Maria was so far coded
    to support only insertions. REPLACE SELECT, INSERT VALUES ON DUPLICATE KEY UPDATE, LOAD DATA REPLACE
    were ok.
    
    mysql-test/r/maria2.result:
      result. Without the code fix, the assertion added to ha_maria::update_row() would fire twice.
    mysql-test/t/maria2.test:
      test when INSERT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE do update rows
    storage/maria/ha_maria.cc:
      Assert that update_row and delete_row never see TL_WRITE_CONCURRENT_INSERT.
      INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE
      must upgrade TL_WRITE_CONCURRENT_INSERT to TL_WRITE because they may update/delete a row.
    41744ed2
ha_maria.cc 104 KB