1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-33330 Server crash or assertion failure in binlog_get_pending_rows_event

When binlog_get_pending_rows_event was refactored, one usage in
binlog_need_stmt_format has not been taken in mind.

As binlog_get_pending_rows_event now requires existing cache_mngr, this check
is now made first.
This commit is contained in:
Nikita Malyavin
2024-02-29 22:52:08 +01:00
parent 7fe764b109
commit 398ae9ee3c
3 changed files with 44 additions and 3 deletions

View File

@@ -3034,9 +3034,14 @@ public:
bool binlog_need_stmt_format(bool is_transactional) const
{
return log_current_statement() &&
!binlog_get_pending_rows_event(binlog_get_cache_mngr(),
use_trans_cache(this, is_transactional));
if (!log_current_statement())
return false;
auto *cache_mngr= binlog_get_cache_mngr();
if (!cache_mngr)
return true;
return !binlog_get_pending_rows_event(cache_mngr,
use_trans_cache(this,
is_transactional));
}
bool binlog_for_noop_dml(bool transactional_table);