summaryrefslogtreecommitdiff
path: root/innobase/include/ut0dbg.h
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/include/ut0dbg.h')
-rw-r--r--innobase/include/ut0dbg.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h
index e99dc8c09d6..802557099fc 100644
--- a/innobase/include/ut0dbg.h
+++ b/innobase/include/ut0dbg.h
@@ -50,6 +50,37 @@ extern ulint* ut_dbg_null_ptr;
}\
}
+/* This can be used if there are % characters in the assertion formula:
+if we try to printf the formula gcc would complain of illegal print
+format characters */
+#define ut_anp(EXPR)\
+{\
+ ulint dbg_i;\
+\
+ if (!((ulint)(EXPR) + ut_dbg_zero)) {\
+ ut_print_timestamp(stderr);\
+ fprintf(stderr,\
+ " InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
+ os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\
+ (ulint)__LINE__);\
+ fprintf(stderr,\
+ "\nInnoDB: We intentionally generate a memory trap.\n");\
+ fprintf(stderr,\
+ "InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n");\
+ ut_dbg_stop_threads = TRUE;\
+ dbg_i = *(ut_dbg_null_ptr);\
+ if (dbg_i) {\
+ ut_dbg_null_ptr = NULL;\
+ }\
+ }\
+ if (ut_dbg_stop_threads) {\
+ fprintf(stderr,\
+ "InnoDB: Thread %lu stopped in file %s line %lu\n",\
+ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
+ os_thread_sleep(1000000000);\
+ }\
+}
+
#define ut_error {\
ulint dbg_i;\
ut_print_timestamp(stderr);\