summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-04-21 10:20:20 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-04-21 10:20:20 +0300
commit28f01f82e1cb682566017b52017469be7638dd49 (patch)
treed496cb0936d25973b95f6eb591508c2e493032b8 /sql/log.cc
parenta3099a3b4a394da360b5c1e7ae6dc985ae2f7f2f (diff)
parent80ed136e6dd4a021b1fc9b7bd7077bf989c3d247 (diff)
downloadmariadb-git-bb-10.6-merge.tar.gz
WIP merge 10.5 to 10.6bb-10.6-merge
FIXME: Disabled tests due to upgrading libmariadb: main.mysql_client_test main.mysql_client_test_nonblock main.mysql_client_test_comp
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc29
1 files changed, 7 insertions, 22 deletions
diff --git a/sql/log.cc b/sql/log.cc
index a31b8dd5598..be94a7f7523 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -10217,28 +10217,13 @@ int TC_LOG_BINLOG::unlog_xa_prepare(THD *thd, bool all)
uint rw_count= ha_count_rw_all(thd, &ha_info);
bool rc= false;
-#ifndef DBUG_OFF
- if (rw_count > 1)
- {
- /*
- There must be no binlog_hton used in a transaction consisting of more
- than 1 engine, *when* (at this point) this transaction has not been
- binlogged. The one exception is if there is an engine without a
- prepare method, as in this case the engine doesn't support XA and
- we have to ignore this check.
- */
- bool binlog= false, exist_hton_without_prepare= false;
- for (ha_info= thd->transaction->all.ha_list; ha_info;
- ha_info= ha_info->next())
- {
- if (ha_info->ht() == binlog_hton)
- binlog= true;
- if (!ha_info->ht()->prepare)
- exist_hton_without_prepare= true;
- }
- DBUG_ASSERT(!binlog || exist_hton_without_prepare);
- }
-#endif
+ /*
+ This transaction has not been binlogged as indicated by need_unlog.
+ Such exceptional cases include transactions with no effect to engines,
+ e.g REPLACE that does not change the dat but still the Engine
+ transaction branch claims to be rw, and few more.
+ In all such cases an empty XA-prepare group of events is bin-logged.
+ */
if (rw_count > 0)
{
/* an empty XA-prepare event group is logged */