MDEV-29069 follow-up optimize find_key and allow PK removal for replication
1. Allowing PK removal/change means that field_index <= master_columns
doesn't guarantee having a value. Remove this condition from
key_parts_suit_event. But now unpack_row is required in
Update_rows_log_event::do_before_row_operations.
2. Move optimization for avoiding m_key allocation inside find_key,
so now it is used by UPDATE events too.
Together with unpack_row, do_before_row_operations is now same for
Update_rows_log_event and Delete_rows_log_event
3. Avoid traversion of all key_parts for all keys for every event.
Use cached usable_key_parts array stored in RPL_TABLE_LIST, which will
be reused for all events on this table instance.
The only reason it needs to be recalculated is changing of row_format,
which can be detected by changes has_values_set bitmap, so last bitmap copy
is also stored there, see RPL_TABLE_LIST::m_usable_keys_data
MDEV-29181 Potential corruption on FK update on a table with vcol index
vc_templ->mysql_table concept is completely broken.
This table pointer persists with a global access and can be overwritten by
arbitrary thread. Like it wasn't enough, it also could become invalid after
eviction from tc cache.
This new solution simply does the following:
* Sets up a referenced table list in TABLE instance (sql_base.cc)
* Iterates through it along with dict_table_t::referenced_set
(row_upd_check_references_constraints)
* Passes corresponding prebuilt through a call chain to
row_ins_foreign_check_on_constraint
* Sets up newly created upd_node_t::prebuilt field and uses it accordingly
is cascade update.
MDEV-29038 XA assertions failing in binlog_rollback and binlog_commit
ONLINE ALTER TABLE adds binlog handlerton into ha_list, so any
rollback command can end up calling binlog_rollback having no cache_mngr,
if binlog is not enabled.
The assertion should be fixed in the same manner as DBUG_ASSERT(WSREP(thd))