diff options
Diffstat (limited to 'sql/signal_handler.cc')
-rw-r--r-- | sql/signal_handler.cc | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 8128dddc7ee..819b87e3fdc 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -102,6 +102,8 @@ extern "C" sig_handler handle_fatal_signal(int sig) "diagnose the problem, but since we have already crashed, \n" "something is definitely wrong and this may fail.\n\n"); + set_server_version(); + my_safe_printf_stderr("Server version: %s\n", server_version); my_safe_printf_stderr("key_buffer_size=%lu\n", (ulong) dflt_key_cache->key_cache_mem_size); @@ -165,37 +167,53 @@ extern "C" sig_handler handle_fatal_signal(int sig) { const char *kreason= "UNKNOWN"; switch (thd->killed) { - case THD::NOT_KILLED: + case NOT_KILLED: + case KILL_HARD_BIT: kreason= "NOT_KILLED"; break; - case THD::KILL_BAD_DATA: + case KILL_BAD_DATA: + case KILL_BAD_DATA_HARD: kreason= "KILL_BAD_DATA"; break; - case THD::KILL_CONNECTION: + case KILL_CONNECTION: + case KILL_CONNECTION_HARD: kreason= "KILL_CONNECTION"; break; - case THD::KILL_QUERY: + case KILL_QUERY: + case KILL_QUERY_HARD: kreason= "KILL_QUERY"; break; - case THD::KILL_SYSTEM_THREAD: + case KILL_SYSTEM_THREAD: + case KILL_SYSTEM_THREAD_HARD: kreason= "KILL_SYSTEM_THREAD"; break; - case THD::KILL_SERVER: + case KILL_SERVER: + case KILL_SERVER_HARD: kreason= "KILL_SERVER"; break; - case THD::KILLED_NO_VALUE: - kreason= "KILLED_NO_VALUE"; - break; } my_safe_printf_stderr("%s", "\n" "Trying to get some variables.\n" "Some pointers may be invalid and cause the dump to abort.\n"); my_safe_printf_stderr("Query (%p): ", thd->query()); - my_safe_print_str(thd->query(), min(1024U, thd->query_length())); + my_safe_print_str(thd->query(), min(65535, thd->query_length())); my_safe_printf_stderr("Connection ID (thread ID): %lu\n", (ulong) thd->thread_id); - my_safe_printf_stderr("Status: %s\n\n", kreason); + my_safe_printf_stderr("Status: %s\n", kreason); + + ulonglong optsw= thd->variables.optimizer_switch; + const char **optimizer_switch_names= optimizer_switch_typelib.type_names; + my_safe_printf_stderr("Optimizer switch: "); + for (uint i= 0; optimizer_switch_names[i+1]; i++, optsw >>= 1) + { + if (i) + my_safe_printf_stderr(","); + my_safe_printf_stderr("%s=%s", + optimizer_switch_names[i], + optsw & 1 ? "on" : "off"); + } + my_safe_printf_stderr("\n\n"); } my_safe_printf_stderr("%s", "The manual page at " |