1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2021-06-01 10:38:09 +03:00
51 changed files with 1536 additions and 798 deletions

View File

@ -7217,10 +7217,24 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data)
error= binlog_log_row(table, old_data, new_data, log_func);
}
#ifdef WITH_WSREP
if (WSREP_NNULL(ha_thd()) && table_share->tmp_table == NO_TMP_TABLE &&
ht->flags & HTON_WSREP_REPLICATION &&
!error && (error= wsrep_after_row(ha_thd())))
return error;
THD *thd= ha_thd();
if (WSREP_NNULL(thd))
{
/* for streaming replication, the following wsrep_after_row()
may replicate a fragment, so we have to declare potential PA
unsafe before that */
if (table->s->primary_key == MAX_KEY && wsrep_thd_is_local(thd))
{
WSREP_DEBUG("marking trx as PA unsafe pk %d", table->s->primary_key);
if (thd->wsrep_cs().mark_transaction_pa_unsafe())
WSREP_DEBUG("session does not have active transaction,"
" can not mark as PA unsafe");
}
if (!error && table_share->tmp_table == NO_TMP_TABLE &&
ht->flags & HTON_WSREP_REPLICATION)
error= wsrep_after_row(thd);
}
#endif /* WITH_WSREP */
}
return error;
@ -7281,11 +7295,23 @@ int handler::ha_delete_row(const uchar *buf)
error= binlog_log_row(table, buf, 0, log_func);
}
#ifdef WITH_WSREP
if (WSREP_NNULL(ha_thd()) && table_share->tmp_table == NO_TMP_TABLE &&
ht->flags & HTON_WSREP_REPLICATION &&
!error && (error= wsrep_after_row(ha_thd())))
THD *thd= ha_thd();
if (WSREP_NNULL(thd))
{
return error;
/* for streaming replication, the following wsrep_after_row()
may replicate a fragment, so we have to declare potential PA
unsafe before that */
if (table->s->primary_key == MAX_KEY && wsrep_thd_is_local(thd))
{
WSREP_DEBUG("marking trx as PA unsafe pk %d", table->s->primary_key);
if (thd->wsrep_cs().mark_transaction_pa_unsafe())
WSREP_DEBUG("session does not have active transaction,"
" can not mark as PA unsafe");
}
if (!error && table_share->tmp_table == NO_TMP_TABLE &&
ht->flags & HTON_WSREP_REPLICATION)
error= wsrep_after_row(thd);
}
#endif /* WITH_WSREP */
}