From 8c909a803d6670c1bc6cb7ae626943c236648477 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 May 2006 10:26:10 -0700 Subject: [PATCH] Bug#19536 "NDB replication fails when no explicit--binlog-format given" fix initialization, storage engine initialization must occur after logging type is configured sql/mysqld.cc: Bug#19536 fix initialization, storage engine initialization must occur after logging type is configured --- sql/mysqld.cc | 87 ++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7d89b67b583..00299607e7d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3012,49 +3012,7 @@ static int init_server_components() unireg_abort(1); } - /* We have to initialize the storage engines before CSV logging */ - if (ha_init()) - { - sql_print_error("Can't init databases"); - unireg_abort(1); - } - -#ifdef WITH_CSV_STORAGE_ENGINE - if (opt_bootstrap) - log_output_options= LOG_FILE; - else - logger.init_log_tables(); - - if (log_output_options & LOG_NONE) - { - /* - Issue a warining if there were specified additional options to the - log-output along with NONE. Probably this wasn't what user wanted. - */ - if ((log_output_options & LOG_NONE) && (log_output_options & ~LOG_NONE)) - sql_print_warning("There were other values specified to " - "log-output besides NONE. Disabling slow " - "and general logs anyway."); - logger.set_handlers(LOG_FILE, LOG_NONE, LOG_NONE); - } - else - { - /* fall back to the log files if tables are not present */ - if (have_csv_db == SHOW_OPTION_NO) - { - sql_print_error("CSV engine is not present, falling back to the " - "log files"); - log_output_options= log_output_options & ~LOG_TABLE | LOG_FILE; - } - - logger.set_handlers(LOG_FILE, opt_slow_log ? log_output_options:LOG_NONE, - opt_log ? log_output_options:LOG_NONE); - } -#else - logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_FILE:LOG_NONE, - opt_log ? LOG_FILE:LOG_NONE); -#endif - + /* need to configure logging before initializing storage engines */ if (opt_update_log) { /* @@ -3182,6 +3140,49 @@ server."); using_update_log=1; } + /* We have to initialize the storage engines before CSV logging */ + if (ha_init()) + { + sql_print_error("Can't init databases"); + unireg_abort(1); + } + +#ifdef WITH_CSV_STORAGE_ENGINE + if (opt_bootstrap) + log_output_options= LOG_FILE; + else + logger.init_log_tables(); + + if (log_output_options & LOG_NONE) + { + /* + Issue a warining if there were specified additional options to the + log-output along with NONE. Probably this wasn't what user wanted. + */ + if ((log_output_options & LOG_NONE) && (log_output_options & ~LOG_NONE)) + sql_print_warning("There were other values specified to " + "log-output besides NONE. Disabling slow " + "and general logs anyway."); + logger.set_handlers(LOG_FILE, LOG_NONE, LOG_NONE); + } + else + { + /* fall back to the log files if tables are not present */ + if (have_csv_db == SHOW_OPTION_NO) + { + sql_print_error("CSV engine is not present, falling back to the " + "log files"); + log_output_options= log_output_options & ~LOG_TABLE | LOG_FILE; + } + + logger.set_handlers(LOG_FILE, opt_slow_log ? log_output_options:LOG_NONE, + opt_log ? log_output_options:LOG_NONE); + } +#else + logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_FILE:LOG_NONE, + opt_log ? LOG_FILE:LOG_NONE); +#endif + /* Check that the default storage engine is actually available. */