mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
945625ebaa
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-mytest-old.c~5237697b30cf59e4: Auto merged Build-tools/Bootstrap: Auto merged Build-tools/mysql-copyright: Auto merged configure.in: Auto merged BitKeeper/deleted/.del-mysql_fix_privilege_tables.sql: Auto merged VC++Files/innobase/innobase.dsp: Auto merged client/mysql.cc: Auto merged include/my_global.h: Auto merged innobase/dict/dict0crea.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/include/mtr0log.h: Auto merged innobase/include/mtr0log.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/ut0dbg.h: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/os/os0file.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/ut/ut0dbg.c: Auto merged innobase/ut/ut0mem.c: Auto merged libmysql/Makefile.am: Auto merged libmysql/Makefile.shared: Auto merged libmysql/conf_to_src.c: Auto merged libmysql/dll.c: Auto merged libmysql/errmsg.c: Auto merged libmysql/manager.c: Auto merged libmysql_r/Makefile.am: Auto merged myisam/mi_key.c: Auto merged mysql-test/Makefile.am: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/having.result: Auto merged mysql-test/r/heap.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/r/type_float.result: Auto merged mysql-test/t/having.test: Auto merged mysql-test/t/heap.test: Auto merged mysql-test/t/type_date.test: Auto merged mysql-test/t/type_float.test: Auto merged mysql-test/t/type_uint.test: Auto merged scripts/make_binary_distribution.sh: Auto merged scripts/make_win_src_distribution.sh: Auto merged sql/Makefile.am: Auto merged sql/field.h: Auto merged sql/ha_heap.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_sum.h: Auto merged sql/lock.cc: Auto merged sql/log.cc: Auto merged sql/protocol.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_analyse.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/french/errmsg.txt: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/share/polish/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged
95 lines
2.7 KiB
C
95 lines
2.7 KiB
C
/*********************************************************************
|
|
Debug utilities for Innobase
|
|
|
|
(c) 1994, 1995 Innobase Oy
|
|
|
|
Created 1/30/1994 Heikki Tuuri
|
|
**********************************************************************/
|
|
|
|
#ifndef ut0dbg_h
|
|
#define ut0dbg_h
|
|
|
|
#include "univ.i"
|
|
#include <stdlib.h>
|
|
#include "os0thread.h"
|
|
|
|
extern ulint ut_dbg_zero; /* This is used to eliminate
|
|
compiler warnings */
|
|
extern ibool ut_dbg_stop_threads;
|
|
|
|
extern ulint* ut_dbg_null_ptr;
|
|
|
|
extern const char* ut_dbg_msg_assert_fail;
|
|
extern const char* ut_dbg_msg_trap;
|
|
extern const char* ut_dbg_msg_stop;
|
|
/* Have a graceful exit on NetWare rather than a segfault to avoid abends */
|
|
#ifdef __NETWARE__
|
|
extern ibool panic_shutdown;
|
|
#define ut_a(EXPR) do {\
|
|
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
|
|
ut_print_timestamp(stderr);\
|
|
fprintf(stderr, ut_dbg_msg_assert_fail,\
|
|
os_thread_pf(os_thread_get_curr_id()), __FILE__,\
|
|
(ulint)__LINE__);\
|
|
fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\
|
|
fputs(ut_dbg_msg_trap, stderr);\
|
|
ut_dbg_stop_threads = TRUE;\
|
|
if (ut_dbg_stop_threads) {\
|
|
fprintf(stderr, ut_dbg_msg_stop,\
|
|
os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
|
|
}\
|
|
if(!panic_shutdown){\
|
|
panic_shutdown = TRUE;\
|
|
innobase_shutdown_for_mysql();}\
|
|
exit(1);\
|
|
}\
|
|
} while (0)
|
|
#define ut_error do {\
|
|
ut_print_timestamp(stderr);\
|
|
fprintf(stderr, ut_dbg_msg_assert_fail,\
|
|
os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
|
|
fprintf(stderr, ut_dbg_msg_trap);\
|
|
ut_dbg_stop_threads = TRUE;\
|
|
if(!panic_shutdown){panic_shutdown = TRUE;\
|
|
innobase_shutdown_for_mysql();}\
|
|
} while (0)
|
|
#else
|
|
#define ut_a(EXPR) do {\
|
|
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
|
|
ut_print_timestamp(stderr);\
|
|
fprintf(stderr, ut_dbg_msg_assert_fail,\
|
|
os_thread_pf(os_thread_get_curr_id()), __FILE__,\
|
|
(ulint)__LINE__);\
|
|
fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\
|
|
fputs(ut_dbg_msg_trap, stderr);\
|
|
ut_dbg_stop_threads = TRUE;\
|
|
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\
|
|
}\
|
|
if (ut_dbg_stop_threads) {\
|
|
fprintf(stderr, ut_dbg_msg_stop,\
|
|
os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
|
|
os_thread_sleep(1000000000);\
|
|
}\
|
|
} while (0)
|
|
|
|
#define ut_error do {\
|
|
ut_print_timestamp(stderr);\
|
|
fprintf(stderr, ut_dbg_msg_assert_fail,\
|
|
os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
|
|
fprintf(stderr, ut_dbg_msg_trap);\
|
|
ut_dbg_stop_threads = TRUE;\
|
|
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\
|
|
} while (0)
|
|
#endif
|
|
|
|
#ifdef UNIV_DEBUG
|
|
#define ut_ad(EXPR) ut_a(EXPR)
|
|
#define ut_d(EXPR) do {EXPR;} while (0)
|
|
#else
|
|
#define ut_ad(EXPR)
|
|
#define ut_d(EXPR)
|
|
#endif
|
|
|
|
#define UT_NOT_USED(A) A = A
|
|
|
|
#endif
|