diff options
author | Andrei Elkin <andrei.elkin@mariadb.com> | 2021-10-12 20:39:31 +0300 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@mariadb.com> | 2021-10-12 20:39:31 +0300 |
commit | 2833707cda2fd0d8b9d7cf404ec2c995ad43383f (patch) | |
tree | 92f46eb3d1b2bf7086992398327ae2bc19a25bb9 | |
parent | 4eb7217ec33fef8d23f2dda0c97b442508c81b1d (diff) | |
download | mariadb-git-bb-10.5-MDEV-26712-andrei.tar.gz |
MDEV-26712 row events never reset thd->mem_rootbb-10.5-MDEV-26712-andrei
but must do that at the end of the statement.
A provide template patch is elaborated also to match
to the upstream fixes of the very same bug.
-rw-r--r-- | sql/log_event_server.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index 790d63502de..9d7306c9d76 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -5793,14 +5793,18 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) } #endif /* WITH_WSREP && HAVE_QUERY_CACHE */ - if (unlikely(get_flags(STMT_END_F) && - (error= rows_event_stmt_cleanup(rgi, thd)))) - slave_rows_error_report(ERROR_LEVEL, - thd->is_error() ? 0 : error, - rgi, thd, table, - get_type_str(), - RPL_LOG_NAME, log_pos); - DBUG_RETURN(error); + if (unlikely(get_flags(STMT_END_F))) + { + if ((error= rows_event_stmt_cleanup(rgi, thd))) + slave_rows_error_report(ERROR_LEVEL, + thd->is_error() ? 0 : error, + rgi, thd, table, + get_type_str(), + RPL_LOG_NAME, log_pos); + if (thd->slave_thread) + free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC)); + } + DBUG_RETURN(error); err: restore_empty_query_table_list(thd->lex); |