MDEV-24700 Assertion "lock not found"==0 in lock_table_x_unlock()
After an ignored INSERT IGNORE statement into an empty table, we would wrongly use the MDEV-515 table-level undo logging for a subsequent REPLACE statement. ha_innobase::reset_template(): Clear m_prebuilt->ins_node->bulk_insert on every statement boundary. ha_innobase::start_stmt(): Invoke end_bulk_insert(). ha_innobase::extra(): Avoid accessing m_prebuilt->trx. Do not call thd_to_trx(). Invoke end_bulk_insert() and try to reset bulk_insert when changing the REPLACE or IGNORE settings. trx_mod_table_time_t::WAS_BULK: Use a distinct value from BULK. trx_undo_report_row_operation(): Add debug assertions. Note: Some calls to end_bulk_insert() may be redundant, but statement boundaries are not always clear in the API (especially in the presence of LOCK TABLES or stored procedures).
Showing
Please register or sign in to comment