summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcmiller@zippy.cornsilk.net <>2007-02-22 10:03:08 -0500
committercmiller@zippy.cornsilk.net <>2007-02-22 10:03:08 -0500
commit6e096ee8d9f5aa2cbe3c2bba4aecde6fceaa888f (patch)
tree1bef9445e8b72c15c47554a6cfa32aef7e32ce69 /include
parentdffdc8118b2af185861eac52f220d96b32c76b37 (diff)
downloadmariadb-git-6e096ee8d9f5aa2cbe3c2bba4aecde6fceaa888f.tar.gz
Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement. --- Bug#24795: SHOW PROFILE Profiling is only partially functional on some architectures. Where there is no getrusage() system call, presently Null values are returned where it would be required. Notably, Windows needs some love applied to make it as useful. Syntax this adds: SHOW PROFILES SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n] where "n" is an integer and "types" is zero or many (comma-separated) of "CPU" "MEMORY" (not presently supported) "BLOCK IO" "CONTEXT SWITCHES" "PAGE FAULTS" "IPC" "SWAPS" "SOURCE" "ALL" It also adds a session variable (boolean) "profiling", set to "no" by default, and (integer) profiling_history_size, set to 15 by default. This patch abstracts setting THDs' "proc_info" behind a macro that can be used as a hook into the profiling code when profiling support is compiled in. All future code in this line should use that mechanism for setting thd->proc_info. --- Tests are now set to omit the statistics. --- Adds an Information_schema table, "profiling" for access to "show profile" data. --- Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795 into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community --- Fix merge problems. --- Fixed one bug in the query_source being NULL. Updated test results. --- Include more thorough profiling tests. Improve support for prepared statements. Use session-specific query IDs, starting at zero. --- Selecting from I_S.profiling is no longer quashed in profiling, as requested by Giuseppe. Limit the size of captured query text. No longer log queries that are zero length.
Diffstat (limited to 'include')
-rw-r--r--include/my_dbug.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/my_dbug.h b/include/my_dbug.h
index a3591f0151a..ba5bddad1bc 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -50,12 +50,12 @@ extern void _db_unlock_file(void);
&_db_framep_)
#define DBUG_LEAVE \
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
-#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
-#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
+#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
+#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
#define DBUG_EXECUTE(keyword,a1) \
- {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
+ do {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}} while(0)
#define DBUG_PRINT(keyword,arglist) \
- {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
+ do {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}} while(0)
#define DBUG_PUSH(a1) _db_push_ (a1)
#define DBUG_POP() _db_pop_ ()
#define DBUG_PROCESS(a1) (_db_process_ = a1)
@@ -63,7 +63,7 @@ extern void _db_unlock_file(void);
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
#define DBUG_DUMP(keyword,a1,a2)\
- {if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
+ do {if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}} while(0)
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
#define DEBUGGER_ON _no_db_=0
@@ -73,7 +73,7 @@ extern void _db_unlock_file(void);
#define DBUG_OUTPUT(A) { _db_output_(A); }
#define DBUG_ASSERT(A) assert(A)
#define DBUG_EXECUTE_IF(keyword,a1) \
- {if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}}
+ do {if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}} while(0)
#else /* No debugger */
#define DBUG_ENTER(a1)