summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-02 15:30:47 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-02 15:30:47 -0300
commit93fb8bb23544a4b5b2a4a6e43e1c25d74ca9a6f0 (patch)
tree9706ada08fda4adc5e2f9cf90b41b72442c15849 /sql/mysqld.cc
parent6d5b440126aa44f838410c11fdf8cadb8df1e04f (diff)
downloadmariadb-git-93fb8bb23544a4b5b2a4a6e43e1c25d74ca9a6f0.tar.gz
Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings generated by GCC 4.4.4 -Wall and -Wextra flags. One major source of warnings was the in-house function my_bcmp which (unconventionally) took pointers to unsigned characters as the byte sequences to be compared. Since my_bcmp and bcmp are deprecated functions whose only difference with memcmp is the return value, every use of the function is replaced with memcmp as the special return value wasn't actually being used by any caller. There were also various other warnings, mostly due to type mismatches, missing return values, missing prototypes, dead code (unreachable) and ignored return values.
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 5514c356bd1..99f16b36dfa 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -559,7 +559,7 @@ ulong query_buff_size, slow_launch_time, slave_open_temp_tables;
ulong open_files_limit, max_binlog_size, max_relay_log_size;
ulong slave_net_timeout, slave_trans_retries;
ulong slave_exec_mode_options;
-const char *slave_exec_mode_str= "STRICT";
+static const char *slave_exec_mode_str= "STRICT";
ulong thread_cache_size=0, thread_pool_size= 0;
ulong binlog_cache_size=0;
ulonglong max_binlog_cache_size=0;
@@ -2464,7 +2464,6 @@ extern "C" sig_handler handle_segfault(int sig)
{
time_t curr_time;
struct tm tm;
- THD *thd=current_thd;
/*
Strictly speaking, one needs a mutex here
@@ -2523,13 +2522,15 @@ the thread stack. Please read http://dev.mysql.com/doc/mysql/en/linux.html\n\n",
#endif /* HAVE_LINUXTHREADS */
#ifdef HAVE_STACKTRACE
+ THD *thd=current_thd;
+
if (!(test_flags & TEST_NO_STACKTRACE))
{
- fprintf(stderr,"thd: 0x%lx\n",(long) thd);
- fprintf(stderr,"\
-Attempting backtrace. You can use the following information to find out\n\
-where mysqld died. If you see no messages after this, something went\n\
-terribly wrong...\n");
+ fprintf(stderr, "thd: 0x%lx\n",(long) thd);
+ fprintf(stderr, "Attempting backtrace. You can use the following "
+ "information to find out\nwhere mysqld died. If "
+ "you see no messages after this, something went\n"
+ "terribly wrong...\n");
my_print_stacktrace(thd ? (uchar*) thd->thread_stack : NULL,
my_thread_stack_size);
}
@@ -7879,10 +7880,11 @@ static int mysql_init_variables(void)
/* Things with default values that are not zero */
delay_key_write_options= (uint) DELAY_KEY_WRITE_ON;
- slave_exec_mode_options= 0;
- slave_exec_mode_options= (uint)
- find_bit_type_or_exit(slave_exec_mode_str, &slave_exec_mode_typelib, NULL,
- &error);
+ slave_exec_mode_options= find_bit_type_or_exit(slave_exec_mode_str,
+ &slave_exec_mode_typelib,
+ NULL, &error);
+ /* Default mode string must not yield a error. */
+ DBUG_ASSERT(!error);
if (error)
return 1;
opt_specialflag= SPECIAL_ENGLISH;
@@ -8118,8 +8120,9 @@ mysqld_get_one_option(int optid,
init_slave_skip_errors(argument);
break;
case OPT_SLAVE_EXEC_MODE:
- slave_exec_mode_options= (uint)
- find_bit_type_or_exit(argument, &slave_exec_mode_typelib, "", &error);
+ slave_exec_mode_options= find_bit_type_or_exit(argument,
+ &slave_exec_mode_typelib,
+ "", &error);
if (error)
return 1;
break;
@@ -8773,7 +8776,7 @@ static int get_options(int *argc,char **argv)
/* Set global MyISAM variables from delay_key_write_options */
fix_delay_key_write((THD*) 0, OPT_GLOBAL);
/* Set global slave_exec_mode from its option */
- fix_slave_exec_mode(OPT_GLOBAL);
+ fix_slave_exec_mode();
#ifndef EMBEDDED_LIBRARY
if (mysqld_chroot)