From b8eaa81dd95259a0a77ecc6fe9a5d736dc1dfcd6 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 5 Feb 2010 10:55:20 -0200 Subject: [PATCH] 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. --- sql/mysqld.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7c45fda1e02..a483b9e2381 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -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 */