diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | dbug/tests.c | 4 | ||||
-rw-r--r-- | include/my_dbug.h | 8 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/log_file_name_debug.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/log_file_name_debug.test | 2 |
5 files changed, 19 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d16252973fe..99120f16d4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,11 @@ IF(SECURITY_HARDENED) MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO) ENDIF() +OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_EXIT()" ON) +IF(WITH_DBUG_TRACE) + ADD_DEFINITIONS(-DDBUG_TRACE) +ENDIF() + # Always enable debug sync for debug builds. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") diff --git a/dbug/tests.c b/dbug/tests.c index 70424046bf4..3e77bf82236 100644 --- a/dbug/tests.c +++ b/dbug/tests.c @@ -4,6 +4,10 @@ char *push1=0; +#ifndef DBUG_TRACE +#define DBUG_TRACE +#endif + #include <my_global.h> /* This includes dbug.h */ #include <my_sys.h> #include <my_pthread.h> diff --git a/include/my_dbug.h b/include/my_dbug.h index 0fe40a9e8cb..debcfc50505 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -64,6 +64,7 @@ extern void dbug_swap_code_state(void **code_state_store); extern void dbug_free_code_state(void **code_state_store); extern const char* _db_get_func_(void); +#ifdef DBUG_TRACE #define DBUG_LEAVE do { \ _db_stack_frame_.line= __LINE__; \ _db_return_ (&_db_stack_frame_); \ @@ -82,6 +83,13 @@ extern const char* _db_get_func_(void); #define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0) #endif +#else +#define DBUG_LEAVE +#define DBUG_ENTER(a) +#define DBUG_RETURN(a1) return(a1) +#define DBUG_VOID_RETURN return +#endif + #define DBUG_EXECUTE(keyword,a1) \ do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0) #define DBUG_EXECUTE_IF(keyword,a1) \ diff --git a/mysql-test/suite/innodb/r/log_file_name_debug.result b/mysql-test/suite/innodb/r/log_file_name_debug.result index ae7ce48fe5e..3fe78c91802 100644 --- a/mysql-test/suite/innodb/r/log_file_name_debug.result +++ b/mysql-test/suite/innodb/r/log_file_name_debug.result @@ -10,5 +10,5 @@ ERROR 42000: Unknown storage engine 'InnoDB' FOUND 1 /InnoDB: Tablespace 4294967280 was not found at .*, but there were no modifications either/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' -FOUND 1 /srv_prepare_to_delete_redo_log_files: ib_log: MLOG_CHECKPOINT.* written/ in mysqld.1.err +FOUND 1 /ib_log: MLOG_CHECKPOINT.* written/ in mysqld.1.err DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/log_file_name_debug.test b/mysql-test/suite/innodb/t/log_file_name_debug.test index d85fbf08194..584d3dc1d5d 100644 --- a/mysql-test/suite/innodb/t/log_file_name_debug.test +++ b/mysql-test/suite/innodb/t/log_file_name_debug.test @@ -39,7 +39,7 @@ SELECT * FROM t1; --source include/restart_mysqld.inc --error ER_UNKNOWN_STORAGE_ENGINE SELECT * FROM t1; ---let SEARCH_PATTERN= srv_prepare_to_delete_redo_log_files: ib_log: MLOG_CHECKPOINT.* written +--let SEARCH_PATTERN= ib_log: MLOG_CHECKPOINT.* written --source include/search_pattern_in_file.inc --let $restart_parameters= |