diff options
author | unknown <monty@mysql.com> | 2004-08-28 00:49:54 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-08-28 00:49:54 +0300 |
commit | db15b91915bb57914e11f226c0130467dd4dcfdd (patch) | |
tree | d8470cb550581be2d6ffbc160a5a1b2b1b17a399 /sql/mysqld.cc | |
parent | 434d385ac17f2bfb553c112b5e19491d0bb0f876 (diff) | |
download | mariadb-git-db15b91915bb57914e11f226c0130467dd4dcfdd.tar.gz |
Code style fixes.
Initialize LOG_error_log before get_options to not use an uninitalized mutex in case of an error from handle_options()
mysql-test/r/lowercase_table.result:
Changed foo database -> mysqltest
More test cases
mysql-test/t/lowercase_table.test:
Changed foo database -> mysqltest
More test cases
mysys/my_getopt.c:
Fix new code to use MySQL indentation style
sql/log.cc:
Change to use MySQL indentation style and naming conventions
Remove usage of strlen() and strcat()
sql/mysqld.cc:
Initialize LOG_error_log before get_options to not use an uninitalized mutex in case of an error from handle_options()
sql/sql_base.cc:
Added comment
sql/table.cc:
Added #if MYSQL_VERSION_ID < 40100 to ensure code is merged correctly
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8b10627b323..1068c5ec9a1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2247,6 +2247,10 @@ int main(int argc, char **argv) if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0]) opt_mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */ + /* needed by get_options */ + + (void) pthread_mutex_init(&LOCK_error_log,MY_MUTEX_INIT_FAST); + set_options(); get_options(argc,argv); set_server_version(); @@ -2263,7 +2267,6 @@ int main(int argc, char **argv) (void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_status,MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_error_log,MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_delayed_insert,MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_delayed_status,MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_delayed_create,MY_MUTEX_INIT_SLOW); @@ -5100,21 +5103,24 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } return 0; } - /* Initiates DEBUG - but no debugging here ! */ -void option_error_reporter( enum loglevel level, const char *format, ... ) + +void option_error_reporter(enum loglevel level, const char *format, ...) { va_list args; - va_start( args, format ); - vprint_msg_to_log( level, format, args ); - va_end( args ); + va_start(args, format); + vprint_msg_to_log(level, format, args); + va_end(args); } + /* Initiates DEBUG - but no debugging here ! */ + static void get_options(int argc,char **argv) { int ho_error; - if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, option_error_reporter ))) + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, + option_error_reporter))) exit(ho_error); #if defined(HAVE_BROKEN_REALPATH) |