summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-03-20 15:23:56 +0200
committerMichael Widenius <monty@askmonty.org>2012-03-20 15:23:56 +0200
commita579adea666cffc3b59d24a3d400d93bc7693d8e (patch)
treebee625e51379dac581a80c7f9ab8a886583d80ce /sql/mysqld.cc
parent51c77ec5d406843bb8c8131f0687f4f75839d045 (diff)
downloadmariadb-git-a579adea666cffc3b59d24a3d400d93bc7693d8e.tar.gz
Cleanups:
- Don't use SAFEMALLOC on valgrind builds (slows things down) - Added back lost option from 5.3: debug-mutex-deadlock-detector - Flush pages before taking lock mutex (speeds up closing of Aria tables). BUILD/SETUP.sh: - Don't use SAFEMALLOC on valgrind builds (slows things down) sql/lock.cc: Make default argument explicit (improves readability) sql/mysqld.cc: Removed compiler warnings Sorted debug options alphabetically Added back lost option from 5.3: debug-mutex-deadlock-detector storage/maria/ma_close.c: Flush pages before taking lock mutex (speeds up closing of Aria tables). storage/maria/ma_open.c: More DBUG_PRINT storage/maria/maria_def.h: Better DBUG_PRINT storage/maria/trnman.c: Better DBUG_PRINT
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc125
1 files changed, 68 insertions, 57 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 7394ce5c931..21653e96854 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5424,8 +5424,10 @@ void handle_connections_sockets()
uint error_count=0;
THD *thd;
struct sockaddr_storage cAddr;
- int ip_flags=0,socket_flags=0,flags=0,retval;
- int extra_ip_flags=0;
+ int ip_flags __attribute__((unused))=0;
+ int socket_flags __attribute__((unused))= 0;
+ int extra_ip_flags __attribute__((unused))=0;
+ int flags=0,retval;
st_vio *vio_tmp;
#ifdef HAVE_POLL
int socket_count= 0;
@@ -6014,17 +6016,6 @@ struct my_option my_long_options[]=
{"help", '?', "Display this help and exit.",
&opt_help, &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
-#ifdef DBUG_OFF
- {"debug", '#', "Built in DBUG debugger. Disabled in this build.",
- &current_dbug_option, &current_dbug_option, 0, GET_STR, OPT_ARG,
- 0, 0, 0, 0, 0, 0},
-#endif
-#ifdef HAVE_REPLICATION
- {"debug-abort-slave-event-count", 0,
- "Option used by mysql-test for debugging and testing of replication.",
- &abort_slave_event_count, &abort_slave_event_count,
- 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#endif /* HAVE_REPLICATION */
{"allow-suspicious-udfs", 0,
"Allows use of UDFs consisting of only one symbol xxx() "
"without corresponding xxx_init() or xxx_deinit(). That also means "
@@ -6093,30 +6084,86 @@ struct my_option my_long_options[]=
/* default-storage-engine should have "MyISAM" as def_value. Instead
of initializing it here it is done in init_common_variables() due
to a compiler bug in Sun Studio compiler. */
+#ifdef DBUG_OFF
+ {"debug", '#', "Built in DBUG debugger. Disabled in this build.",
+ &current_dbug_option, &current_dbug_option, 0, GET_STR, OPT_ARG,
+ 0, 0, 0, 0, 0, 0},
+#endif
+#ifdef HAVE_REPLICATION
+ {"debug-abort-slave-event-count", 0,
+ "Option used by mysql-test for debugging and testing of replication.",
+ &abort_slave_event_count, &abort_slave_event_count,
+ 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#endif /* HAVE_REPLICATION */
+#ifndef DBUG_OFF
+ {"debug-assert-on-error", 0,
+ "Do an assert in various functions if we get a fatal error",
+ &my_assert_on_error, &my_assert_on_error,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-assert-if-crashed-table", 0,
+ "Do an assert in handler::print_error() if we get a crashed table",
+ &debug_assert_if_crashed_table, &debug_assert_if_crashed_table,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+#endif
+#ifdef HAVE_REPLICATION
+ {"debug-disconnect-slave-event-count", 0,
+ "Option used by mysql-test for debugging and testing of replication.",
+ &disconnect_slave_event_count, &disconnect_slave_event_count,
+ 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#endif /* HAVE_REPLICATION */
+ {"debug-exit-info", 'T', "Used for debugging. Use at your own risk.",
+ 0, 0, 0, GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-gdb", 0,
+ "Set up signals usable for debugging.",
+ &opt_debugging, &opt_debugging,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef HAVE_REPLICATION
+ {"debug-max-binlog-dump-events", 0,
+ "Option used by mysql-test for debugging and testing of replication.",
+ &max_binlog_dump_events, &max_binlog_dump_events, 0,
+ GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#endif /* HAVE_REPLICATION */
+#ifdef SAFE_MUTEX
+ {"debug-mutex-deadlock-detector", 0,
+ "Enable checking of wrong mutex usage.",
+ &safe_mutex_deadlock_detector,
+ &safe_mutex_deadlock_detector,
+ 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+#endif
+ {"debug-no-sync", 0,
+ "Disables system sync calls. Only for running tests or debugging!",
+ &my_disable_sync, &my_disable_sync, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+#ifdef HAVE_REPLICATION
+ {"debug-sporadic-binlog-dump-fail", 0,
+ "Option used by mysql-test for debugging and testing of replication.",
+ &opt_sporadic_binlog_dump_fail,
+ &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ 0},
+#endif /* HAVE_REPLICATION */
{"default-storage-engine", 0, "The default storage engine for new tables",
&default_storage_engine, 0, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0 },
{"default-time-zone", 0, "Set the default time zone.",
&default_tz_name, &default_tz_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+#if defined(ENABLED_DEBUG_SYNC)
+ {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT,
+ "Enable the debug sync facility "
+ "and optionally specify a default wait timeout in seconds. "
+ "A zero value keeps the facility disabled.",
+ &opt_debug_sync_timeout, 0,
+ 0, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, 0, 0, 0},
+#endif /* defined(ENABLED_DEBUG_SYNC) */
#ifdef HAVE_OPENSSL
{"des-key-file", 0,
"Load keys for des_encrypt() and des_encrypt from given file.",
&des_key_file, &des_key_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif /* HAVE_OPENSSL */
-#ifdef HAVE_REPLICATION
- {"debug-disconnect-slave-event-count", 0,
- "Option used by mysql-test for debugging and testing of replication.",
- &disconnect_slave_event_count, &disconnect_slave_event_count,
- 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#endif /* HAVE_REPLICATION */
#ifdef HAVE_STACKTRACE
{"stack-trace", 0 , "Print a symbolic stack trace on failure",
&opt_stack_trace, &opt_stack_trace, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#endif /* HAVE_STACKTRACE */
- {"debug-exit-info", 'T', "Used for debugging. Use at your own risk.", 0, 0, 0,
- GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"external-locking", 0, "Use system (external) locking (disabled by "
"default). With this option enabled you can run myisamchk to test "
"(not repair) tables while the MySQL server is running. Disable with "
@@ -6128,10 +6175,6 @@ struct my_option my_long_options[]=
"Set up signals usable for debugging. Deprecated, use --debug-gdb instead.",
&opt_debugging, &opt_debugging,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"debug-gdb", 0,
- "Set up signals usable for debugging.",
- &opt_debugging, &opt_debugging,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_LARGE_PAGE_OPTION
{"super-large-pages", 0, "Enable support for super large pages.",
&opt_super_large_pages, &opt_super_large_pages, 0,
@@ -6222,10 +6265,6 @@ struct my_option my_long_options[]=
{"init-rpl-role", 0, "Set the replication role.",
&rpl_status, &rpl_status, &rpl_role_typelib,
GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"debug-max-binlog-dump-events", 0,
- "Option used by mysql-test for debugging and testing of replication.",
- &max_binlog_dump_events, &max_binlog_dump_events, 0,
- GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_REPLICATION */
{"memlock", 0, "Lock mysqld in memory.", &locked_in_memory,
&locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -6331,13 +6370,6 @@ struct my_option my_long_options[]=
"(Default: 15000).", &slow_start_timeout, &slow_start_timeout, 0,
GET_ULONG, REQUIRED_ARG, 15000, 0, 0, 0, 0, 0},
#endif
-#ifdef HAVE_REPLICATION
- {"debug-sporadic-binlog-dump-fail", 0,
- "Option used by mysql-test for debugging and testing of replication.",
- &opt_sporadic_binlog_dump_fail,
- &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
- 0},
-#endif /* HAVE_REPLICATION */
#ifdef HAVE_OPENSSL
{"ssl", 0,
"Enable SSL for connection (automatically enabled with other flags).",
@@ -6359,9 +6391,6 @@ struct my_option my_long_options[]=
files.
*/
IF_VALGRIND(0,IF_WIN(0,1)), 0, 0, 0, 0, 0},
- {"debug-no-sync", 0,
- "Disables system sync calls. Only for running tests or debugging!",
- &my_disable_sync, &my_disable_sync, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"sysdate-is-now", 0,
"Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. "
"Since 5.0, SYSDATE() returns a `dynamic' value different for different "
@@ -6372,14 +6401,6 @@ struct my_option my_long_options[]=
"Decision to use in heuristic recover process. Possible values are COMMIT "
"or ROLLBACK.", &tc_heuristic_recover, &tc_heuristic_recover,
&tc_heuristic_recover_typelib, GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#if defined(ENABLED_DEBUG_SYNC)
- {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT,
- "Enable the debug sync facility "
- "and optionally specify a default wait timeout in seconds. "
- "A zero value keeps the facility disabled.",
- &opt_debug_sync_timeout, 0,
- 0, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, 0, 0, 0},
-#endif /* defined(ENABLED_DEBUG_SYNC) */
{"temp-pool", 0,
#if (ENABLE_TEMP_POOL)
"Using this option will cause most temporary files created to use a small "
@@ -6409,16 +6430,6 @@ struct my_option my_long_options[]=
{"table_cache", 0, "Deprecated; use --table-open-cache instead.",
&table_cache_size, &table_cache_size, 0, GET_ULONG,
REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
-#ifndef DBUG_OFF
- {"debug-assert-on-error", 0,
- "Do an assert in various functions if we get a fatal error",
- &my_assert_on_error, &my_assert_on_error,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"debug-assert-if-crashed-table", 0,
- "Do an assert in handler::print_error() if we get a crashed table",
- &debug_assert_if_crashed_table, &debug_assert_if_crashed_table,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};