summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2022-07-19 01:19:11 +0300
committerNikita Malyavin <nikitamalyavin@gmail.com>2023-04-18 00:29:51 +0300
commitd885da75303c2cf847507024a205e7a3a14a93a5 (patch)
treeaaaee5780e062f3971ad4da112c70e0d41b2a049 /sql
parent1223b4e43a21a837db3771ae06cc16fc09683b62 (diff)
downloadmariadb-git-d885da75303c2cf847507024a205e7a3a14a93a5.tar.gz
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))
Diffstat (limited to 'sql')
-rw-r--r--sql/log.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 8c37f989255..5fda1563ec6 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2329,6 +2329,8 @@ int binlog_commit(THD *thd, bool all, bool ro_1pc)
PSI_stage_info org_stage;
DBUG_ENTER("binlog_commit");
+ IF_DBUG(bool commit_online= !thd->online_alter_cache_list.empty(),);
+
bool is_ending_transaction= ending_trans(thd, all);
error= binlog_online_alter_end_trans(thd, all, true);
if (error)
@@ -2340,7 +2342,7 @@ int binlog_commit(THD *thd, bool all, bool ro_1pc)
*/
if (!cache_mngr)
{
- DBUG_ASSERT(WSREP(thd) ||
+ DBUG_ASSERT(WSREP(thd) || commit_online ||
(thd->lex->sql_command != SQLCOM_XA_PREPARE &&
!(thd->lex->sql_command == SQLCOM_XA_COMMIT &&
thd->lex->xa_opt == XA_ONE_PHASE)));
@@ -2448,7 +2450,7 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
if (!cache_mngr)
{
DBUG_ASSERT(WSREP(thd) || rollback_online);
- DBUG_ASSERT(thd->lex->sql_command != SQLCOM_XA_ROLLBACK);
+ DBUG_ASSERT(thd->lex->sql_command != SQLCOM_XA_ROLLBACK || rollback_online);
DBUG_RETURN(0);
}