summaryrefslogtreecommitdiff
path: root/include/mysql/service_debug_sync.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mysql/service_debug_sync.h')
-rw-r--r--include/mysql/service_debug_sync.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/mysql/service_debug_sync.h b/include/mysql/service_debug_sync.h
index 752c27b2c64..0bd49a13458 100644
--- a/include/mysql/service_debug_sync.h
+++ b/include/mysql/service_debug_sync.h
@@ -337,11 +337,18 @@ extern void (*debug_sync_C_callback_ptr)(MYSQL_THD, const char *, size_t);
#define DEBUG_SYNC(thd, name) \
do { \
if (debug_sync_service) \
- debug_sync_service(thd, name, sizeof(name)-1); \
+ debug_sync_service(thd, STRING_WITH_LEN(name)); \
+ } while(0)
+
+#define DEBUG_SYNC_C_IF_THD(thd, name) \
+ do { \
+ if (debug_sync_service && thd) \
+ debug_sync_service((MYSQL_THD) thd, STRING_WITH_LEN(name)); \
} while(0)
#else
-#define DEBUG_SYNC(thd,name) do { } while(0)
-#endif
+#define DEBUG_SYNC(thd,name) do { } while(0)
+#define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_) do { } while(0)
+#endif /* defined(ENABLED_DEBUG_SYNC) */
/* compatibility macro */
#define DEBUG_SYNC_C(name) DEBUG_SYNC(NULL, name)