Commit b8eaa81d authored by Davi Arnaut's avatar Davi Arnaut

Bug#49025: mysqld-debug: missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "?func"

The problem was that the dbug facility was being used after the
per-thread dbug state had already been finalized. The was present
in a few functions which invoked decrement_handler_count, which
in turn invokes my_thread_end on Windows. In my_thread_end, the
per-thread dbug state is finalized. Any use after the state is
finalized ends up creating a new state.

The solution is to process the exit of a function before the
decrement_handler_count function is called.


sql/mysqld.cc:
  Process the function exit before decrement_handler_count is
  called, as it can end the per-thread dbug state on Windows.
parent 6b8ec684
......@@ -5213,9 +5213,9 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
create_new_thread(thd);
}
DBUG_LEAVE;
decrement_handler_count();
DBUG_RETURN(0);
return 0;
}
......@@ -5311,8 +5311,9 @@ pthread_handler_t handle_connections_namedpipes(void *arg)
create_new_thread(thd);
}
CloseHandle(connectOverlapped.hEvent);
DBUG_LEAVE;
decrement_handler_count();
DBUG_RETURN(0);
return 0;
}
#endif /* __NT__ */
......@@ -5548,9 +5549,9 @@ error:
if (handle_connect_file_map) CloseHandle(handle_connect_file_map);
if (event_connect_answer) CloseHandle(event_connect_answer);
if (smem_event_connect_request) CloseHandle(smem_event_connect_request);
DBUG_LEAVE;
decrement_handler_count();
DBUG_RETURN(0);
return 0;
}
#endif /* HAVE_SMEM */
#endif /* EMBEDDED_LIBRARY */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment