summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2023-01-11 15:37:27 +0300
committerAleksey Midenkov <midenok@gmail.com>2023-01-11 23:38:51 +0300
commit97f466ec60866adced97a4139170bfcb4dc05b36 (patch)
treeb837cf08e36c1a1bfb8dcf8aba5c4b26d6fdd79d
parenta3db96efb68238068f6371e9f950618abb3b88e2 (diff)
downloadmariadb-git-bb-10.4-midenok.tar.gz
Rebase fixbb-10.4-midenok
-rw-r--r--storage/innobase/handler/ha_innodb.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 972c0738f5b..e3d5a0309bf 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -8389,8 +8389,7 @@ calc_row_difference(
uchar* upd_buff,
ulint buff_len,
row_prebuilt_t* prebuilt,
- ib_uint64_t& auto_inc,
- int sql_command)
+ ib_uint64_t& auto_inc)
{
uchar* original_upd_buff = upd_buff;
Field* field;
@@ -8769,11 +8768,12 @@ calc_row_difference(
ut_a(buf <= (byte*) original_upd_buff + buff_len);
- /* Used to avoid history in FK check on DELETE (see MDEV-16210). */
+ const TABLE_LIST *tl= table->pos_in_table_list;
+ const uint8 op_map= tl->trg_event_map | tl->slave_fk_event_map;
+ /* Used to avoid reading history in FK check on DELETE (see MDEV-16210). */
prebuilt->upd_node->is_delete =
- ((sql_command == SQLCOM_DELETE
- || sql_command == SQLCOM_DELETE_MULTI)
- && table->versioned(VERS_TIMESTAMP))
+ (op_map & trg2bit(TRG_EVENT_DELETE)
+ /*&& table->versioned(VERS_TIMESTAMP)*/)
? VERSIONED_DELETE : NO_DELETE;
if (prebuilt->versioned_write && uvect->affects_versioned()) {
@@ -8923,7 +8923,7 @@ ha_innobase::update_row(
error = calc_row_difference(
uvect, old_row, new_row, table, m_upd_buf, m_upd_buf_size,
- m_prebuilt, autoinc, thd_sql_command(m_user_thd));
+ m_prebuilt, autoinc);
if (error != DB_SUCCESS) {
goto func_exit;