diff options
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 01f5c9eb1e9..612a49f03ab 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -462,8 +462,15 @@ typedef struct system_status_var ulong com_stmt_fetch; ulong com_stmt_reset; ulong com_stmt_close; - /* + Number of statements sent from the client + */ + ulong questions; + /* + IMPORTANT! + SEE last_system_status_var DEFINITION BELOW. + Below 'last_system_status_var' are all variables which doesn't make any + sense to add to the /global/ status variable counter. Status variables which it does not make sense to add to global status variable counter */ @@ -476,7 +483,7 @@ typedef struct system_status_var counter */ -#define last_system_status_var com_stmt_close +#define last_system_status_var questions void mark_transaction_to_rollback(THD *thd, bool all); @@ -1009,6 +1016,7 @@ show_system_thread(enum_thread_type thread) { #define RETURN_NAME_AS_STRING(NAME) case (NAME): return #NAME switch (thread) { + static char buf[64]; RETURN_NAME_AS_STRING(NON_SYSTEM_THREAD); RETURN_NAME_AS_STRING(SYSTEM_THREAD_DELAYED_INSERT); RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_IO); @@ -1016,9 +1024,11 @@ show_system_thread(enum_thread_type thread) RETURN_NAME_AS_STRING(SYSTEM_THREAD_NDBCLUSTER_BINLOG); RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_SCHEDULER); RETURN_NAME_AS_STRING(SYSTEM_THREAD_EVENT_WORKER); + default: + sprintf(buf, "<UNKNOWN SYSTEM THREAD: %d>", thread); + return buf; } #undef RETURN_NAME_AS_STRING - return "UNKNOWN"; /* keep gcc happy */ } /** @@ -2118,8 +2128,8 @@ public: Don't reset binlog format for NDB binlog injector thread. */ DBUG_PRINT("debug", - ("temporary_tables: %p, in_sub_stmt: %d, system_thread: %s", - temporary_tables, in_sub_stmt, + ("temporary_tables: %s, in_sub_stmt: %s, system_thread: %s", + YESNO(temporary_tables), YESNO(in_sub_stmt), show_system_thread(system_thread))); if ((temporary_tables == NULL) && (in_sub_stmt == 0) && (system_thread != SYSTEM_THREAD_NDBCLUSTER_BINLOG)) |