MXS-1913: Check session before invoking dcb_foreach callback

If the session is the dummy session, the callback should not be called.
This commit is contained in:
Markus Mäkelä
2018-06-12 09:31:24 +03:00
parent d9100278b0
commit 24870e278c

View File

@ -2908,6 +2908,10 @@ public:
for (DCB *dcb = this_unit.all_dcbs[thread_id]; for (DCB *dcb = this_unit.all_dcbs[thread_id];
dcb && atomic_load_int32(&m_more); dcb && atomic_load_int32(&m_more);
dcb = dcb->thread.next) dcb = dcb->thread.next)
{
ss_dassert(dcb->session);
if (dcb->session->state != SESSION_STATE_DUMMY)
{ {
if (!m_func(dcb, m_data)) if (!m_func(dcb, m_data))
{ {
@ -2916,6 +2920,7 @@ public:
} }
} }
} }
}
bool more() const bool more() const
{ {