Skip to content
/ server Public

Commit 5d2da8e

Browse files
committed
MDEV-38408 WITH_DBUG_TRACE=OFF doesn't disable DBUG_DUMP or DBUG_LOG
DBUG_DUMP(), DBUG_LOG(): Null expand unless DBUG_TRACE is enabled. Fixes up commit a69cf6f (MDEV-29613)
1 parent 7093e1c commit 5d2da8e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/my_dbug.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ extern int (*dbug_sanity)(void);
7979

8080
#define DBUG_PRINT(keyword,arglist) \
8181
do if (_db_pargs_(__LINE__,keyword)) _db_doprnt_ arglist; while(0)
82+
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
8283

8384
#ifdef HAVE_ATTRIBUTE_CLEANUP
8485
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_ __attribute__((cleanup(_db_return_))); \
@@ -98,6 +99,7 @@ extern int (*dbug_sanity)(void);
9899
#define DBUG_RETURN(a1) return(a1)
99100
#define DBUG_VOID_RETURN return
100101
#define DBUG_PRINT(keyword,arglist) do{} while(0)
102+
#define DBUG_DUMP(keyword,a1,a2) do{} while(0)
101103
#endif
102104

103105
#define DBUG_EXECUTE(keyword,a1) \
@@ -116,7 +118,6 @@ extern int (*dbug_sanity)(void);
116118
#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
117119
#define DBUG_PROCESS(a1) _db_process_(a1)
118120
#define DBUG_FILE _db_fp_()
119-
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
120121
#define DBUG_END() _db_end_ ()
121122
#define DBUG_LOCK_FILE _db_lock_file_()
122123
#define DBUG_UNLOCK_FILE _db_unlock_file_()
@@ -236,7 +237,7 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
236237
one should #include <sstream>. We intentionally avoid including it here to save
237238
compilation time.
238239
*/
239-
# ifdef DBUG_OFF
240+
# if defined DBUG_OFF || !defined DBUG_TRACE
240241
# define DBUG_LOG(keyword, v) do {} while (0)
241242
# else
242243
# define DBUG_LOG(keyword, v) do { \

sql/log_event.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class Write_on_release_cache
216216
Log_event *m_ev; // Used for Flashback
217217
};
218218

219-
#ifndef DBUG_OFF
219+
#if !defined DBUG_OFF && defined DBUG_TRACE
220220
#define DBUG_DUMP_EVENT_BUF(B,L) \
221221
do { \
222222
const uchar *_buf=(uchar*)(B); \

sql/rpl_record.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
100100
length is stored in little-endian format, since this is the
101101
format used for the binlog.
102102
*/
103-
#ifndef DBUG_OFF
103+
#if !defined DBUG_OFF && defined DBUG_TRACE
104104
const uchar *old_pack_ptr= pack_ptr;
105105
#endif
106106
pack_ptr= field->pack(pack_ptr, field->ptr + offset,

0 commit comments

Comments
 (0)