Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit f82cea1

Browse files
committed
BUG#34045080 Failure with the THD::mem_cnt pointer
Post merge fix, to relax an assert. Thd_mem_cnt::enable() no longer require that THD is associated with some performance schema instrumentation, because this can in fact not be enforced: the THD <--> performance_schema thread instrumentation can change over time, so testing that a performance schema thread instrumentation actually exists when Thd_mem_cnt::enable() is called goes not give any guarantees about the existence of a thread instrumentation when Thd_mem_cnt::alloc_cnt() is called. This fix relaxes the asserts in Thd_mem_cnt::alloc_cnt(), because there is no guarantee that a performance schema thread instrumentation is in place for the THD used. This is especially important for replication, when a replication thread A can pick up a different session B and operate on B on its behalf, see Thd_backup_and_restore() Approved by: Tor Didriksen <tor.didriksen@oracle.com>
1 parent d10ce8f commit f82cea1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sql/sql_class.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ bool Thd_mem_cnt::alloc_cnt(size_t size) {
166166
return false;
167167
}
168168

169-
assert(!opt_initialize && m_thd->get_psi() != nullptr);
169+
assert(!opt_initialize && m_thd != nullptr);
170170
assert(!m_thd->kill_immunizer || !m_thd->kill_immunizer->is_active() ||
171171
!is_error_mode());
172172
assert(m_thd->is_killable);

0 commit comments

Comments
 (0)