summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-08-18 01:48:01 +0300
committerunknown <heikki@hundin.mysql.fi>2004-08-18 01:48:01 +0300
commit0c062ae60f9dbb21ce3702389f89e4441451d02b (patch)
tree3374aa426a2d37a0fbcffeba922bae916fb0febd /innobase/include
parent35daaa5e1544a4162f85aa3f071a668fe6f21a9d (diff)
downloadmariadb-git-0c062ae60f9dbb21ce3702389f89e4441451d02b.tar.gz
srv0start.c, ut0mem.c, ut0dbg.c, ut0dbg.h, srv0start.h:
Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) mysqld.cc, ha_innodb.cc: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) sql/ha_innodb.cc: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) sql/mysqld.cc: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) innobase/include/srv0start.h: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) innobase/include/ut0dbg.h: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) innobase/ut/ut0dbg.c: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) innobase/ut/ut0mem.c: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri) innobase/srv/srv0start.c: Changes for NetWare to exit the InnoDB gracefully instead of crashing the server (patch by PRam@novell.com, polished a little by Heikki Tuuri)
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/srv0start.h4
-rw-r--r--innobase/include/ut0dbg.h34
2 files changed, 36 insertions, 2 deletions
diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h
index c4c8dac5d7a..539ccb32744 100644
--- a/innobase/include/srv0start.h
+++ b/innobase/include/srv0start.h
@@ -63,11 +63,13 @@ innobase_start_or_create_for_mysql(void);
/* out: DB_SUCCESS or error code */
/********************************************************************
Shuts down the Innobase database. */
-
int
innobase_shutdown_for_mysql(void);
/*=============================*/
/* out: DB_SUCCESS or error code */
+#ifdef __NETWARE__
+void set_panic_flag_for_netware(void);
+#endif
extern ulint srv_sizeof_trx_t_in_ha_innodb_cc;
diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h
index bec9cdd42b5..fe6aba2cccb 100644
--- a/innobase/include/ut0dbg.h
+++ b/innobase/include/ut0dbg.h
@@ -22,7 +22,38 @@ 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);\
@@ -49,6 +80,7 @@ extern const char* ut_dbg_msg_stop;
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)