From 3017b77987c77f19465eb341ee2ee00500aab783 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Jan 2006 13:41:15 +0300 Subject: [PATCH 01/14] Use one option --log-output[=option[,option...]] instead of current --old-log-format and --both-log-formats options mysql-test/mysql-test-run.pl: use new option instead of the old one for testing mysql-test/r/im_utils.result: correct result file sql/log.cc: use log event handler flags instead of enum_printer sql/log.h: Add log event handler flags to simplify log option processing --- mysql-test/mysql-test-run.pl | 2 +- mysql-test/r/im_utils.result | 4 +- sql/log.cc | 67 ++++++++++++++------------ sql/log.h | 24 ++++------ sql/mysqld.cc | 92 ++++++++++++++++++++---------------- 5 files changed, 102 insertions(+), 87 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e0bbeec7a87..971e49e108e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1832,7 +1832,7 @@ EOF ; print OUT "nonguarded\n" if $instance->{'nonguarded'}; - print OUT "old-log-format\n" if $instance->{'old_log_format'}; + print OUT "log-output=FILE\n" if $instance->{'old_log_format'}; print OUT "\n"; } diff --git a/mysql-test/r/im_utils.result b/mysql-test/r/im_utils.result index e204affc8ec..504b2efe4af 100644 --- a/mysql-test/r/im_utils.result +++ b/mysql-test/r/im_utils.result @@ -21,7 +21,7 @@ skip-stack-trace VALUE skip-innodb VALUE skip-bdb VALUE skip-ndbcluster VALUE -old-log-format VALUE +log-output VALUE SHOW INSTANCE OPTIONS mysqld2; option_name value instance_name VALUE @@ -42,7 +42,7 @@ skip-stack-trace VALUE skip-innodb VALUE skip-bdb VALUE skip-ndbcluster VALUE -old-log-format VALUE +log-output VALUE START INSTANCE mysqld2; STOP INSTANCE mysqld2; SHOW mysqld1 LOG FILES; diff --git a/sql/log.cc b/sql/log.cc index b2f7eb582a7..8743eeb08ba 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -596,7 +596,7 @@ void LOGGER::init_base() file_log_handler= new Log_to_file_event_handler; /* by default we use traditional error log */ - init_error_log(LEGACY); + init_error_log(LOG_FILE); file_log_handler->init_pthread_objects(); (void) pthread_mutex_init(&LOCK_logger, MY_MUTEX_INIT_SLOW); @@ -804,41 +804,47 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command, return error; } -void LOGGER::init_error_log(enum enum_printer error_log_printer) +void LOGGER::init_error_log(uint error_log_printer) { - switch (error_log_printer) { - case NONE: + if (error_log_printer & LOG_NONE) + { error_log_handler_list[0]= 0; - break; - case LEGACY: + return; + } + + switch (error_log_printer) { + case LOG_FILE: error_log_handler_list[0]= file_log_handler; error_log_handler_list[1]= 0; break; /* these two are disabled for now */ - case CSV: + case LOG_TABLE: DBUG_ASSERT(0); break; - case LEGACY_AND_CSV: + case LOG_TABLE|LOG_FILE: DBUG_ASSERT(0); break; } } -void LOGGER::init_slow_log(enum enum_printer slow_log_printer) +void LOGGER::init_slow_log(uint slow_log_printer) { - switch (slow_log_printer) { - case NONE: + if (slow_log_printer & LOG_NONE) + { slow_log_handler_list[0]= 0; - break; - case LEGACY: + return; + } + + switch (slow_log_printer) { + case LOG_FILE: slow_log_handler_list[0]= file_log_handler; slow_log_handler_list[1]= 0; break; - case CSV: + case LOG_TABLE: slow_log_handler_list[0]= table_log_handler; slow_log_handler_list[1]= 0; break; - case LEGACY_AND_CSV: + case LOG_TABLE|LOG_FILE: slow_log_handler_list[0]= file_log_handler; slow_log_handler_list[1]= table_log_handler; slow_log_handler_list[2]= 0; @@ -846,21 +852,24 @@ void LOGGER::init_slow_log(enum enum_printer slow_log_printer) } } -void LOGGER::init_general_log(enum enum_printer general_log_printer) +void LOGGER::init_general_log(uint general_log_printer) { - switch (general_log_printer) { - case NONE: + if (general_log_printer & LOG_NONE) + { general_log_handler_list[0]= 0; - break; - case LEGACY: + return; + } + + switch (general_log_printer) { + case LOG_FILE: general_log_handler_list[0]= file_log_handler; general_log_handler_list[1]= 0; break; - case CSV: + case LOG_TABLE: general_log_handler_list[0]= table_log_handler; general_log_handler_list[1]= 0; break; - case LEGACY_AND_CSV: + case LOG_TABLE|LOG_FILE: general_log_handler_list[0]= file_log_handler; general_log_handler_list[1]= table_log_handler; general_log_handler_list[2]= 0; @@ -891,20 +900,20 @@ bool Log_to_csv_event_handler::init() return (open_log_table(QUERY_LOG_GENERAL) || open_log_table(QUERY_LOG_SLOW)); } -int LOGGER::set_handlers(enum enum_printer error_log_printer, - enum enum_printer slow_log_printer, - enum enum_printer general_log_printer) +int LOGGER::set_handlers(uint error_log_printer, + uint slow_log_printer, + uint general_log_printer) { /* error log table is not supported yet */ - DBUG_ASSERT(error_log_printer < CSV); + DBUG_ASSERT(error_log_printer < LOG_TABLE); lock(); - if ((slow_log_printer >= CSV || general_log_printer >= CSV) && + if ((slow_log_printer & LOG_TABLE || general_log_printer & LOG_TABLE) && !is_log_tables_initialized) { - slow_log_printer= LEGACY; - general_log_printer= LEGACY; + slow_log_printer= (slow_log_printer & ~LOG_TABLE) | LOG_FILE; + general_log_printer= (general_log_printer & ~LOG_TABLE) | LOG_FILE; sql_print_error("Failed to initialize log tables. " "Falling back to the old-fashioned logs"); diff --git a/sql/log.h b/sql/log.h index d709a73a391..d79e6bb48bd 100644 --- a/sql/log.h +++ b/sql/log.h @@ -138,14 +138,10 @@ typedef struct st_log_info */ #define MAX_LOG_HANDLERS_NUM 3 -enum enum_printer -{ - NONE, - LEGACY, - CSV, - LEGACY_AND_CSV -}; - +/* log event handler flags */ +#define LOG_NONE 1 +#define LOG_FILE 2 +#define LOG_TABLE 4 class Log_event; class Rows_log_event; @@ -491,12 +487,12 @@ public: bool reopen_log_table(uint log_type); /* we use this function to setup all enabled log event handlers */ - int set_handlers(enum enum_printer error_log_printer, - enum enum_printer slow_log_printer, - enum enum_printer general_log_printer); - void init_error_log(enum enum_printer error_log_printer); - void init_slow_log(enum enum_printer slow_log_printer); - void init_general_log(enum enum_printer general_log_printer); + int set_handlers(uint error_log_printer, + uint slow_log_printer, + uint general_log_printer); + void init_error_log(uint error_log_printer); + void init_slow_log(uint slow_log_printer); + void init_general_log(uint general_log_printer); }; #endif /* LOG_H */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 27cdc800a6a..6dbf084f9b9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -297,8 +297,16 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] = {&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}, {&Arg_comparator::compare_decimal, &Arg_comparator::compare_e_decimal}}; +const char *log_output_names[] = +{ "NONE", "FILE", "TABLE", NullS}; +TYPELIB log_output_typelib= {array_elements(log_output_names)-1,"", + log_output_names, NULL}; + /* static variables */ +/* the default log output is log tables */ +static const char *log_output_str= "TABLE"; +static ulong log_output_options= LOG_TABLE; static bool lower_case_table_names_used= 0; static bool volatile select_thread_in_use, signal_thread_in_use; static bool volatile ready_to_exit; @@ -332,9 +340,6 @@ static my_bool opt_sync_bdb_logs; bool opt_log, opt_update_log, opt_bin_log, opt_slow_log; bool opt_error_log= IF_WIN(1,0); -#ifdef WITH_CSV_STORAGE_ENGINE -bool opt_old_log_format, opt_both_log_formats; -#endif bool opt_disable_networking=0, opt_skip_show_db=0; my_bool opt_character_set_client_handshake= 1; bool server_id_supplied = 0; @@ -2395,8 +2400,8 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) sql_print_information("Got signal %d to shutdown mysqld",sig); #endif /* switch to the old log message processing */ - logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE, - opt_log ? LEGACY:NONE); + logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_FILE:LOG_NONE, + opt_log ? LOG_FILE:LOG_NONE); DBUG_PRINT("info",("Got signal: %d abort_loop: %d",sig,abort_loop)); if (!abort_loop) { @@ -2425,8 +2430,8 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) (TABLE_LIST*) 0, ¬_used); // Flush logs } /* reenable logs after the options were reloaded */ - logger.set_handlers(LEGACY, opt_slow_log ? CSV:NONE, - opt_log ? CSV:NONE); + logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_TABLE:LOG_NONE, + opt_log ? LOG_TABLE:LOG_NONE); break; #ifdef USE_ONE_SIGNAL_HAND case THR_SERVER_ALARM: @@ -3085,21 +3090,20 @@ static int init_server_components() #ifdef WITH_CSV_STORAGE_ENGINE logger.init_log_tables(); - if (opt_old_log_format || (have_csv_db != SHOW_OPTION_YES)) - logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE, - opt_log ? LEGACY:NONE); + if (log_output_options & LOG_NONE) + logger.set_handlers(LOG_FILE, LOG_NONE, LOG_NONE); else - if (opt_both_log_formats) - logger.set_handlers(LEGACY, - opt_slow_log ? LEGACY_AND_CSV:NONE, - opt_log ? LEGACY_AND_CSV:NONE); - else - /* the default is CSV log tables */ - logger.set_handlers(LEGACY, opt_slow_log ? CSV:NONE, - opt_log ? CSV:NONE); + { + /* fall back to the log files if tables are not present */ + if (have_csv_db == SHOW_OPTION_NO) + 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(LEGACY, opt_slow_log ? LEGACY:NONE, - opt_log ? LEGACY:NONE); + logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_FILE:LOG_NONE, + opt_log ? LOG_FILE:LOG_NONE); #endif if (opt_update_log) @@ -4676,8 +4680,8 @@ enum options_mysqld OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE, OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID, OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER, - OPT_ABORT_SLAVE_EVENT_COUNT, OPT_OLD_LOG_FORMAT, OPT_BOTH_LOG_FORMATS, - OPT_INNODB_DATA_HOME_DIR, + OPT_ABORT_SLAVE_EVENT_COUNT, + OPT_INNODB_DATA_HOME_DIR, OPT_LOG_OUTPUT, OPT_INNODB_DATA_FILE_PATH, OPT_INNODB_LOG_GROUP_HOME_DIR, OPT_INNODB_LOG_ARCH_DIR, @@ -5217,6 +5221,13 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, {"log-long-format", '0', "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef WITH_CSV_STORAGE_ENGINE + {"log-output", OPT_LOG_OUTPUT, + "Syntax: log-output[=option[,option...]], where option can be TABLE, " + "FILE or NONE.", + (gptr*) &log_output_str, (gptr*) &log_output_str, 0, + GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES, "Log queries that are executed without benefit of any index to the slow log if it is open.", (gptr*) &opt_log_queries_not_using_indexes, (gptr*) &opt_log_queries_not_using_indexes, @@ -5238,16 +5249,6 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, "Log slow queries to this log file. Defaults logging to hostname-slow.log file. Must be enabled to activate other slow log options.", (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef WITH_CSV_STORAGE_ENGINE - {"old-log-format", OPT_OLD_LOG_FORMAT, - "Enable old log file format. (No SELECT * FROM logs)", - (gptr*) &opt_old_log_format, 0, 0, GET_BOOL, OPT_ARG, - 0, 0, 0, 0, 0, 0}, - {"both-log-formats", OPT_BOTH_LOG_FORMATS, - "Enable old log file format along with log tables", - (gptr*) &opt_both_log_formats, 0, 0, GET_BOOL, OPT_ARG, - 0, 0, 0, 0, 0, 0}, -#endif {"log-tc", OPT_LOG_TC, "Path to transaction coordinator log (used for transactions that affect " "more than one storage engine, when binary log is disabled)", @@ -6940,10 +6941,6 @@ static void mysql_init_variables(void) opt_skip_slave_start= opt_reckless_slave = 0; mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0; opt_log= opt_update_log= opt_slow_log= 0; -#ifdef WITH_CSV_STORAGE_ENGINE - opt_old_log_format= 0; - opt_both_log_formats= 0; -#endif opt_bin_log= 0; opt_disable_networking= opt_skip_show_db=0; opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0; @@ -7357,12 +7354,25 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_slow_log= 1; break; #ifdef WITH_CSV_STORAGE_ENGINE - case (int) OPT_OLD_LOG_FORMAT: - opt_old_log_format= 1; - break; - case (int) OPT_BOTH_LOG_FORMATS: - opt_both_log_formats= 1; + case OPT_LOG_OUTPUT: + { + if (!argument || !argument[0]) + { + log_output_options= LOG_TABLE; + log_output_str= log_output_typelib.type_names[1]; + } + else + { + log_output_str= argument; + if ((log_output_options= + find_bit_type(argument, &log_output_typelib)) == ~(ulong) 0) + { + fprintf(stderr, "Unknown option to log-output: %s\n", argument); + exit(1); + } + } break; + } #endif case (int) OPT_SKIP_NEW: opt_specialflag|= SPECIAL_NO_NEW_FUNC; From c21fe93c13ba325705f9acb667021b0a6d4123a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Feb 2006 14:31:43 +0300 Subject: [PATCH 02/14] post-review fixes to WL#3117 Change option handling for the log tables. sql/mysqld.cc: post-review fixes --- sql/mysqld.cc | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6dbf084f9b9..32297949665 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3091,12 +3091,26 @@ static int init_server_components() 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); @@ -4681,7 +4695,7 @@ enum options_mysqld OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID, OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER, OPT_ABORT_SLAVE_EVENT_COUNT, - OPT_INNODB_DATA_HOME_DIR, OPT_LOG_OUTPUT, + OPT_INNODB_DATA_HOME_DIR, OPT_INNODB_DATA_FILE_PATH, OPT_INNODB_LOG_GROUP_HOME_DIR, OPT_INNODB_LOG_ARCH_DIR, @@ -4823,6 +4837,7 @@ enum options_mysqld OPT_LOG_SLOW_ADMIN_STATEMENTS, OPT_TABLE_LOCK_WAIT_TIMEOUT, OPT_PLUGIN_DIR, + OPT_LOG_OUTPUT, OPT_PORT_OPEN_TIMEOUT }; @@ -5223,7 +5238,7 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef WITH_CSV_STORAGE_ENGINE {"log-output", OPT_LOG_OUTPUT, - "Syntax: log-output[=option[,option...]], where option can be TABLE, " + "Syntax: log-output[=value[,value...]], where \"value\" could be TABLE, " "FILE or NONE.", (gptr*) &log_output_str, (gptr*) &log_output_str, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -7365,10 +7380,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), { log_output_str= argument; if ((log_output_options= - find_bit_type(argument, &log_output_typelib)) == ~(ulong) 0) + find_bit_type(argument, &log_output_typelib)) == ~(ulong) 0) { - fprintf(stderr, "Unknown option to log-output: %s\n", argument); - exit(1); + fprintf(stderr, "Unknown option to log-output: %s\n", argument); + exit(1); } } break; From 9aac55c4c06a5f81b4cbf43be0d7d2a549ef0789 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Feb 2006 17:30:44 +0300 Subject: [PATCH 03/14] cleanup sql/mysql_priv.h: remove reference to variable removed in the previous patch --- sql/mysql_priv.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 589ca1349c1..f856fa5111a 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1305,7 +1305,6 @@ extern my_bool locked_in_memory; extern bool opt_using_transactions, mysqld_embedded; extern bool using_update_log, opt_large_files, server_id_supplied; extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log, opt_error_log; -extern bool opt_old_log_format; extern bool opt_disable_networking, opt_skip_show_db; extern my_bool opt_character_set_client_handshake; extern bool volatile abort_loop, shutdown_in_progress, grant_option; From ef7015fab2c0b5b328534f190718801db10cd30a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Feb 2006 18:36:13 +0300 Subject: [PATCH 04/14] post-merge fix --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index cbf99aee4ad..7f09b2526c7 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3092,7 +3092,7 @@ static int init_server_components() #ifdef WITH_CSV_STORAGE_ENGINE if (opt_bootstrap) - opt_old_log_format= TRUE; + log_output_options= LOG_FILE; else logger.init_log_tables(); From e36d465222f31e2fcfa597ebfec10afba6588f1a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Feb 2006 17:42:04 +0100 Subject: [PATCH 05/14] scripts/make_binary_distribution.sh : Adaption of the 5.1.6 build clone to the new "storage" directory layer, already done in the general tree by Jani. scripts/make_binary_distribution.sh: Adaption of the 5.1.6 build clone to the new "storage" directory layer, already done in the general tree by Jani: 2006/02/02 16:22:22+02:00 jani@ua141d10.elisa.omakaista.fi +2 -2 Fix to reflect change in directory structure. --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f1ed07382b6..2f59c3e1d4c 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -129,8 +129,8 @@ copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - myisam/myisam_ftdump$BS \ + storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ + storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ From 4a7347d8b13eabab9dc171f0c5ae21dfe56579e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Feb 2006 19:06:55 +0100 Subject: [PATCH 06/14] scripts/make_binary_distribution.sh : Care about the debug server in the 5.1 packages. scripts/make_binary_distribution.sh: As of 5.1, any package will contain both an optimized and a debugging server, built with identical configuration (features / table handlers). This "mysqld-debug" must be contained in the package. Also, the server will not be stripped any more. Also, get rid of the old compatibility symlink "safe_mysqld" dating back to 4.0. --- scripts/make_binary_distribution.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2f59c3e1d4c..b3dfc53f716 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -131,7 +131,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ - sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ + sql/mysqld$BS sql/mysqld-debug$BS sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqlslap$BS \ @@ -173,8 +173,9 @@ if [ x$STRIP = x1 ] ; then strip $BASE/bin/* fi -# Copy not binary files -copyfileto $BASE/bin sql/mysqld.sym.gz +# Obsolete, starting from 5.1.6-beta +# # Copy not binary files +# copyfileto $BASE/bin sql/mysqld.sym.gz if [ $BASE_SYSTEM = "netware" ] ; then $CP netware/*.pl $BASE/scripts @@ -304,11 +305,12 @@ else rm -f $BASE/README.NW fi -# Make safe_mysqld a symlink to mysqld_safe for backwards portability -# To be removed in MySQL 4.1 -if [ $BASE_SYSTEM != "netware" ] ; then - (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -fi +# Dropped with 5.1.6-beta +# # Make safe_mysqld a symlink to mysqld_safe for backwards portability +# # To be removed in MySQL 4.1 +# if [ $BASE_SYSTEM != "netware" ] ; then +# (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) +# fi # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then From d4e3c827537fb0204e216f68c634e69290f75e30 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Feb 2006 22:39:55 +0100 Subject: [PATCH 07/14] sql_plugin.cc: Bug#17196, --default-storage-engine option broken configure.in: This is an alpha configure.in: This is an alpha sql/sql_plugin.cc: Bug#17196, --default-storage-engine option broken --- configure.in | 2 +- sql/sql_plugin.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 2f5a6cde7c3..ffc311a7857 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.1.6-beta) +AM_INIT_AUTOMAKE(mysql, 5.1.6-alpha) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index b8628b18dd4..9f17694a137 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -345,7 +345,7 @@ struct st_plugin_int *plugin_lock(LEX_STRING *name, int type) rw_wrlock(&THR_LOCK_plugin); if ((rc= plugin_find_internal(name, type))) { - if (rc->state == PLUGIN_IS_READY) + if (rc->state == PLUGIN_IS_READY || rc->state == PLUGIN_IS_UNINITIALIZED) rc->ref_count++; else rc= 0; From 8835aa9683a124d12149997260ba76a74b574d6e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Feb 2006 11:42:17 +0100 Subject: [PATCH 08/14] Modified RPM spec to match new 5.1 debug+max combined community packaging. --- support-files/mysql.spec.sh | 194 +++++++++++------------------------- 1 file changed, 60 insertions(+), 134 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 3242b18dd42..24f5ce41824 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -114,8 +114,6 @@ Group: Applications/Databases This package contains the ndbcluster storage engine. It is necessary to have this package installed on all computers that should store ndbcluster table data. -Note that this storage engine can only be used in conjunction -with the MySQL Max server. %{see_base} @@ -181,29 +179,6 @@ Group: Applications/Databases This package contains the shared libraries (*.so*) which certain languages and applications need to dynamically load and use MySQL. -%package Max -Summary: MySQL - server with extended functionality -Group: Applications/Databases -Provides: mysql-Max -Obsoletes: mysql-Max -Requires: MySQL-server >= @MYSQL_BASE_VERSION@ - -%description Max -Optional MySQL server binary that supports additional features like: - - - Berkeley DB Storage Engine - - Ndbcluster Storage Engine interface - - Archive Storage Engine - - CSV Storage Engine - - Example Storage Engine - - Federated Storage Engine - - User Defined Functions (UDFs). - -To activate this binary, just install this package in addition to -the standard MySQL package. - -Please note that this is a dynamically linked binary! - %package embedded Requires: %{name}-devel Summary: MySQL - embedded library @@ -224,7 +199,11 @@ client/server version. %{see_base} %prep -%setup -n mysql-%{mysql_version} +# We unpack the source twice, once for debug and once for release build. +%setup -T -a 0 -c -n mysql-%{mysql_version} +mv mysql-%{mysql_version} mysql-debug-%{mysql_version} +%setup -D -T -a 0 -n mysql-%{mysql_version} +mv mysql-%{mysql_version} mysql-release-%{mysql_version} %build @@ -234,10 +213,8 @@ BuildMySQL() { sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ CC=\"${CC:-$MYSQL_BUILD_CC}\" \ CXX=\"${CXX:-$MYSQL_BUILD_CXX}\" \ - CFLAGS=\"${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS}\" \ - CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS \ - -felide-constructors -fno-exceptions -fno-rtti \ - }\" \ + CFLAGS=\"$CFLAGS\" \ + CXXFLAGS=\"$CXXFLAGS\" \ ./configure \ $* \ --enable-assembler \ @@ -280,7 +257,6 @@ fi # Use the build root for temporary storage of the shared libraries. RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} # Clean up the BuildRoot first [ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR; @@ -292,8 +268,7 @@ mkdir -p $RBR%{_libdir}/mysql PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin} export PATH -# Build the Max binary (includes BDB and UDFs and therefore -# cannot be linked statically against the patched glibc) +# Build the Debug binary. # Use gcc for C and C++ code (to avoid a dependency on libstdc++ and # including exceptions into the code @@ -303,6 +278,35 @@ then export CXX="gcc" fi +# Strip -Oxxx, add -g and --with-debug. +(cd mysql-debug-%{mysql_version} && +CFLAGS=`echo "${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS} -g" | sed -e 's/-O[0-9]*//g'` \ +CXXFLAGS=`echo "${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti} -g" | sed -e 's/-O[0-9]*//g'` \ +BuildMySQL "--enable-shared \ + --with-debug \ + --with-berkeley-db \ + --with-innodb \ + --with-ndbcluster \ + --with-archive-storage-engine \ + --with-csv-storage-engine \ + --with-example-storage-engine \ + --with-blackhole-storage-engine \ + --with-federated-storage-engine \ + --with-big-tables \ + --with-comment=\"MySQL Community Edition - Debug (GPL)\"") + +# We might want to save the config log file +if test -n "$MYSQL_DEBUGCONFLOG_DEST" +then + cp -fp mysql-debug-%{mysql_version}/config.log "$MYSQL_DEBUGCONFLOG_DEST" +fi + +(cd mysql-debug-%{mysql_version} && make test-force) || true + +# Build release binary. +(cd mysql-release-%{mysql_version} && +CFLAGS="${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS} -g" \ +CXXFLAGS="${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti} -g" \ BuildMySQL "--enable-shared \ --with-berkeley-db \ --with-innodb \ @@ -313,86 +317,19 @@ BuildMySQL "--enable-shared \ --with-blackhole-storage-engine \ --with-federated-storage-engine \ --with-big-tables \ - --with-comment=\"MySQL Community Edition - Experimental (GPL)\" \ - --with-server-suffix='-max'" - -# We might want to save the config log file -if test -n "$MYSQL_MAXCONFLOG_DEST" -then - cp -fp config.log "$MYSQL_MAXCONFLOG_DEST" -fi - -make test-force || true - -# Save mysqld-max -# check if mysqld was installed in .libs/ -if test -f sql/.libs/mysqld -then - cp sql/.libs/mysqld sql/mysqld-max -else - cp sql/mysqld sql/mysqld-max -fi -nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym -# Save the perror binary so it supports the NDB error codes (BUG#13740) -mv extra/perror extra/perror.ndb - -# Install the ndb binaries -(cd ndb; make install DESTDIR=$RBR) - -# Include libgcc.a in the devel subpackage (BUG 4921) -if expr "$CC" : ".*gcc.*" > /dev/null ; -then - libgcc=`$CC --print-libgcc-file` - if [ -f $libgcc ] - then - %define have_libgcc 1 - install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a - fi -fi - -# Save libraries -(cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*) -(cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*) -(cd ndb/src/.libs; tar rf $RBR/shared-libs.tar *.so*) - -# Now clean up -make clean - -# -# Only link statically on our i386 build host (which has a specially -# patched static glibc installed) - ia64 and x86_64 run glibc-2.3 (unpatched) -# so don't link statically there -# -BuildMySQL "--disable-shared \ -%if %{STATIC_BUILD} - --with-mysqld-ldflags='-all-static' \ - --with-client-ldflags='-all-static' \ - $USE_OTHER_LIBC_DIR \ -%endif - --with-zlib-dir=bundled \ - --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ - --with-server-suffix='%{server_suffix}' \ - --with-archive-storage-engine \ - --with-innodb \ - --with-big-tables" -if test -f sql/.libs/mysqld -then - nm --numeric-sort sql/.libs/mysqld > sql/mysqld.sym -else - nm --numeric-sort sql/mysqld > sql/mysqld.sym -fi + --with-comment=\"MySQL Community Edition (GPL)\"") # We might want to save the config log file if test -n "$MYSQL_CONFLOG_DEST" then - cp -fp config.log "$MYSQL_CONFLOG_DEST" + cp -fp mysql-release-%{mysql_version}/config.log "$MYSQL_CONFLOG_DEST" fi -make test-force || true +(cd mysql-release-%{mysql_version} && make test-force) || true %install RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} +MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-release-%{mysql_version} # Ensure that needed directories exists install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} @@ -404,21 +341,22 @@ install -d $RBR%{_mandir} install -d $RBR%{_sbindir} -# Install all binaries stripped -make install-strip DESTDIR=$RBR benchdir_root=%{_datadir} +# Install all binaries +(cd $MBD && make install DESTDIR=$RBR benchdir_root=%{_datadir}) +# Old packages put shared libs in %{_libdir}/ (not %{_libdir}/mysql), so do +# the same here. +mv $RBR/%{_libdir}/mysql/*.so* $RBR/%{_libdir}/ -# Install shared libraries (Disable for architectures that don't support it) -(cd $RBR%{_libdir}; tar xf $RBR/shared-libs.tar; rm -f $RBR/shared-libs.tar) - -# install saved mysqld-max -install -s -m 755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max +# install mysqld-debug +if test -f $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/.libs/mysqld +then + install -m 755 $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/.libs/mysqld $RBR%{_sbindir}/mysqld-debug +else + install -m 755 $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/mysqld $RBR%{_sbindir}/mysqld-debug +fi # install saved perror binary with NDB support (BUG#13740) -install -s -m 755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror - -# install symbol files ( for stack trace resolution) -install -m 644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym -install -m 644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym +install -m 755 $MBD/extra/perror $RBR%{_bindir}/perror # Install logrotate and autostart install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql @@ -510,11 +448,6 @@ mysql_clusterdir=/var/lib/mysql-cluster if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi -%post Max -# Restart mysqld, to use the new binary. -echo "Restarting mysqld." -%{_sysconfdir}/init.d/mysql restart > /dev/null 2>&1 - %preun server if test $1 = 0 then @@ -546,9 +479,9 @@ fi %files server %defattr(-,root,root,0755) -%doc COPYING README -%doc support-files/my-*.cnf -%doc support-files/ndb-*.ini +%doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README +%doc mysql-release-%{mysql_version}/support-files/my-*.cnf +%doc mysql-release-%{mysql_version}/support-files/ndb-*.ini %doc %attr(644, root, root) %{_infodir}/mysql.info* @@ -597,9 +530,9 @@ fi %attr(755, root, root) %{_bindir}/safe_mysqld %attr(755, root, root) %{_sbindir}/mysqld +%attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/mysqlmanager %attr(755, root, root) %{_sbindir}/rcmysql -%attr(644, root, root) %{_libdir}/mysql/mysqld.sym %attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql %attr(755, root, root) %{_sysconfdir}/init.d/mysql @@ -631,6 +564,7 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1* %post shared /sbin/ldconfig @@ -666,7 +600,7 @@ fi %files devel %defattr(-, root, root, 0755) -%doc EXCEPTIONS-CLIENT +%doc mysql-release-%{mysql_version}/EXCEPTIONS-CLIENT %doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1* %attr(755, root, root) %{_bindir}/comp_err %attr(755, root, root) %{_bindir}/mysql_config @@ -675,9 +609,6 @@ fi %{_includedir}/mysql/* %{_libdir}/mysql/libdbug.a %{_libdir}/mysql/libheap.a -%if %{have_libgcc} -%{_libdir}/mysql/libmygcc.a -%endif %{_libdir}/mysql/libmyisam.a %{_libdir}/mysql/libmyisammrg.a %{_libdir}/mysql/libmysqlclient.a @@ -706,11 +637,6 @@ fi %attr(755, root, root) %{_bindir}/mysqltestmanager-pwgen %attr(755, root, root) %{_bindir}/mysqltestmanagerc -%files Max -%defattr(-, root, root, 0755) -%attr(755, root, root) %{_sbindir}/mysqld-max -%attr(644, root, root) %{_libdir}/mysql/mysqld-max.sym - %files embedded %defattr(-, root, root, 0755) # %attr(644, root, root) %{_libdir}/mysql/libmysqld.a From caf576164865a005e18314fd2720dfc8adcd1f83 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Feb 2006 11:59:45 +0100 Subject: [PATCH 09/14] 5.1.6 release ndb dd - fix problem with O_DIRECT on some platforms storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp: reopen wo/ O_DIRECT if firts write fails --- .../ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index 6947a4902a1..e0324c2c8ea 100644 --- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -370,7 +370,6 @@ void AsyncFile::openReq(Request* request) const int mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; -retry: if(flags & FsOpenReq::OM_CREATE_IF_NONE){ if((theFd = ::open(theFileName.c_str(), new_flags, mode)) != -1) { close(theFd); @@ -432,6 +431,7 @@ retry: m_fs.EXECUTE_DIRECT(block, GSN_FSWRITEREQ, signal, FsReadWriteReq::FixedLength + 1); + retry: Uint32 size = request->par.open.page_size; char* buf = (char*)m_page_ptr.p; while(size > 0){ @@ -449,9 +449,21 @@ retry: } if(size != 0) { + int err = errno; +#ifdef O_DIRECT + if ((new_flags & O_DIRECT) && off == 0) + { + ndbout_c("error on first write(%d), disable O_DIRECT", err); + new_flags &= ~O_DIRECT; + close(theFd); + theFd = ::open(theFileName.c_str(), new_flags, mode); + if (theFd != -1) + goto retry; + } +#endif close(theFd); unlink(theFileName.c_str()); - request->error = errno; + request->error = err; return; } off += request->par.open.page_size; From bfcd35e923e0f7586d59d273b670f0e95babe16d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Feb 2006 19:01:54 +0100 Subject: [PATCH 10/14] Link errors in 5.1.6 on Solaris in debug builds, overcome by not building two NDB test programs. storage/ndb/src/kernel/blocks/Makefile.am: Fix proposed by Jonas Oreland: Stop building "ndb_print_file", it is just for testing. storage/ndb/src/kernel/blocks/dbtup/Makefile.am: Fix proposed by Jonas Oreland: Stop building "test_varpage", it is just for testing. --- storage/ndb/src/kernel/blocks/Makefile.am | 2 +- storage/ndb/src/kernel/blocks/dbtup/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/Makefile.am b/storage/ndb/src/kernel/blocks/Makefile.am index 389d0cc7aaa..d30ad0c844d 100644 --- a/storage/ndb/src/kernel/blocks/Makefile.am +++ b/storage/ndb/src/kernel/blocks/Makefile.am @@ -20,7 +20,7 @@ noinst_LIBRARIES = libblocks.a INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/kernel/blocks/dblqh libblocks_a_SOURCES = tsman.cpp lgman.cpp pgman.cpp diskpage.cpp restore.cpp -ndbtools_PROGRAMS = ndb_print_file +EXTRA_PROGRAMS = ndb_print_file ndb_print_file_SOURCES = print_file.cpp diskpage.cpp dbtup/tuppage.cpp ndb_print_file_LDFLAGS = @ndb_bin_am_ldflags@ \ $(top_builddir)/storage/ndb/src/libndbclient.la \ diff --git a/storage/ndb/src/kernel/blocks/dbtup/Makefile.am b/storage/ndb/src/kernel/blocks/dbtup/Makefile.am index bc6b975a980..b33f60a9be2 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Makefile.am +++ b/storage/ndb/src/kernel/blocks/dbtup/Makefile.am @@ -42,7 +42,7 @@ libdbtup.dsp: Makefile \ @$(top_srcdir)/storage/ndb/config/win-sources $@ $(libdbtup_a_SOURCES) @$(top_srcdir)/storage/ndb/config/win-libraries $@ LIB $(LDADD) -ndbtest_PROGRAMS = test_varpage +EXTRA_PROGRAMS = test_varpage test_varpage_SOURCES = test_varpage.cpp tuppage.cpp test_varpage_LDFLAGS = @ndb_bin_am_ldflags@ \ $(top_builddir)/storage/ndb/src/libndbclient.la \ From e653fbc322fd06b6350e848b3675faee3c05ce42 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Feb 2006 03:11:45 +0100 Subject: [PATCH 11/14] Makefile.am: Link with CLIENT_EXTRA_LDFLAGS, enable us to pass on libtool flags '-full-static' and '-static' using '--with-client-ldflags' to configure. mysql.spec.sh: Pass '-static' to libtool, link static with our own libraries, dynamic with system libraries. Link with the bundled zlib. support-files/mysql.spec.sh: Pass '-static' to libtool, link static with our own libraries, dynamic with system libraries. Link with the bundled zlib. server-tools/instance-manager/Makefile.am: Link with CLIENT_EXTRA_LDFLAGS, enable us to pass on libtool flags '-full-static' and '-static' using '--with-client-ldflags' to configure. --- server-tools/instance-manager/Makefile.am | 3 ++- support-files/mysql.spec.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am index 7449735f0bf..7afadf03ec1 100644 --- a/server-tools/instance-manager/Makefile.am +++ b/server-tools/instance-manager/Makefile.am @@ -79,7 +79,8 @@ mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \ mysql_manager_error.h \ portability.h -mysqlmanager_LDADD= liboptions.a \ +mysqlmanager_LDADD= @CLIENT_EXTRA_LDFLAGS@ \ + liboptions.a \ libnet.a \ $(top_builddir)/vio/libvio.a \ $(top_builddir)/mysys/libmysys.a \ diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 24f5ce41824..62f2bdb668d 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -217,6 +217,9 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ CXXFLAGS=\"$CXXFLAGS\" \ ./configure \ $* \ + --with-mysqld-ldflags='-static' \ + --with-client-ldflags='-static' \ + --with-zlib-dir=bundled \ --enable-assembler \ --enable-local-infile \ --with-mysqld-user=%{mysqld_user} \ From 36f6cc3b7e8a14a889c4e5015df8af85959c173a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Feb 2006 10:34:18 +0100 Subject: [PATCH 12/14] MySQL Bugs: #17283: Issues with killing "bankTransactionMaker" (and others) in 86 tests --- mysql-test/t/rpl_ndb_bank.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/t/rpl_ndb_bank.test b/mysql-test/t/rpl_ndb_bank.test index 1b900236963..817f40f2fa3 100644 --- a/mysql-test/t/rpl_ndb_bank.test +++ b/mysql-test/t/rpl_ndb_bank.test @@ -10,14 +10,14 @@ # 5. check that the slave and master BANK databases are the same # -# kill any trailing processes ---system killall lt-bankTransactionMaker lt-bankTimer lt-bankMakeGL || true - --source include/have_ndb.inc --source include/have_ndb_extra.inc --source include/have_binlog_format_row.inc --source include/master-slave.inc +# kill any trailing processes +--system killall lt-bankTransactionMaker lt-bankTimer lt-bankMakeGL || true + --disable_warnings # initialize master --connection master From 3b0eec9cb79ac12807f15f0e8ab6d2cee5356180 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Feb 2006 12:39:31 +0100 Subject: [PATCH 13/14] storage/innobase/include/univ.i : Get rid of "extern inline" (part of innodb-5.0-149/162 snapshots). storage/innobase/include/univ.i: Part of innodb-5.0-149/162 snapshots: Avoid breaking --with-debug builds on QNX and other systems whose compiler pretends to be GCC 2. Outside __WIN__ define UNIV_INLINE as static inline. --- storage/innobase/include/univ.i | 6 ------ 1 file changed, 6 deletions(-) diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 15650f22ed8..dd4862b3808 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -126,14 +126,8 @@ by one. */ #ifdef __WIN__ #define UNIV_INLINE __inline #else -/* config.h contains the right def for 'inline' for the current compiler */ -#if (__GNUC__ == 2) -#define UNIV_INLINE extern inline -#else -/* extern inline doesn't work with gcc 3.0.2 */ #define UNIV_INLINE static inline #endif -#endif #else /* If we want to compile a noninlined version we use the following macro From 0d4cae389d37017123950a930516a442e27f529e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Feb 2006 13:50:22 +0100 Subject: [PATCH 14/14] Several Netware specific fixes. Originally, done by Jani and pushed to the general 5.1 tree as ChangeSet 2006/02/02 16:22:31+02:00 jani@ua141d10.elisa.omakaista.fi now just copied to the 5.1.6 build clone. configure.in: To configure InnoDB for cross compilation. include/config-netware.h: NetWare specific change to fix the compilation errors caused by event.h NetWare specific change required for WINE PATH and for new versions LibC(Jun 05) and zlib(1.2.3) netware/BUILD/compile-AUTOTOOLS: Netware specific change reflecting the change in source code directory structure. netware/BUILD/compile-linux-tools: Netware specific change to fix the location where gen_lex_hash gets created. Fixed also directory structure reflecting changes. netware/BUILD/compile-netware-END: Netware specific change for creating mysqld_error.h netware/BUILD/mwenv: Netware specific change required for WINE PATH and for new versions LibC(Jun 05) and zlib(1.2.3). netware/BUILD/nwbootstrap: NetWare Specific change to produce absoulte path for XDC file. netware/Makefile.am: Netware specific changes to fix to match new directory structure. netware/my_manage.h: Netware specific change required for WINE PATH and for new versions LibC(Jun 05) and zlib(1.2.3). ((I fail to understand the above comment for this change - seems just to be a number alignment and a "#define NULL". Joerg)) netware/mysql_test_run.c: Netware specific change, added --autoclose option for mysql_test_run.nlm. sql/mysqld.cc: Stacksize change for Netware. Netware specific change to fix the compilation errors caused by event.h sql/set_var.cc: Minor indending related fix. sql/sql_class.cc: Added #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION macro. storage/innobase/os/os0thread.c: Netware specific change to increase the thread stack size. storage/myisam/mi_locking.c: Enclosed MMAP related code under HAVE_MMAP preprocessor directive. --- configure.in | 5 ++++- include/config-netware.h | 21 +++++++++++++++++++++ netware/BUILD/compile-AUTOTOOLS | 2 +- netware/BUILD/compile-linux-tools | 8 ++++---- netware/BUILD/compile-netware-END | 5 ++--- netware/BUILD/mwenv | 6 +++--- netware/BUILD/nwbootstrap | 10 ++++++++-- netware/Makefile.am | 11 +++++++---- netware/my_manage.h | 3 ++- netware/mysql_test_run.c | 19 +++++++++++++------ sql/mysqld.cc | 12 +++++++++++- sql/set_var.cc | 5 +++-- sql/sql_class.cc | 2 ++ storage/innobase/os/os0thread.c | 9 +++++++++ storage/myisam/mi_locking.c | 18 ++++++++++-------- 15 files changed, 100 insertions(+), 36 deletions(-) diff --git a/configure.in b/configure.in index ffc311a7857..951ca0f9405 100644 --- a/configure.in +++ b/configure.in @@ -2548,9 +2548,12 @@ AC_SUBST(CC) AC_SUBST(GXX) # Set configuration options for make_binary_distribution + +CONF_ARGS= case $SYSTEM_TYPE in *netware*) MAKE_BINARY_DISTRIBUTION_OPTIONS=--no-strip + CONF_ARGS=--host="$MACHINE_TYPE-$SYSTEM_TYPE" ;; *) MAKE_BINARY_DISTRIBUTION_OPTIONS= @@ -2558,7 +2561,7 @@ case $SYSTEM_TYPE in esac for CONF in $other_configures; do - (cd `dirname $CONF`; ./`basename $CONF` --build=$build_alias) + (cd `dirname $CONF`; ./`basename $CONF` $CONF_ARGS --build=$build_alias) done AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS) diff --git a/include/config-netware.h b/include/config-netware.h index 5a8b926a669..e2fc75ab90d 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -19,6 +19,14 @@ #ifndef _config_netware_h #define _config_netware_h +#define __event_h__ +#define _EVENT_H_ +/* + These two #define(s) are needed as both libc of NetWare and MySQL have + files named event.h which causes compilation errors. +*/ + + /* required headers */ #include #include @@ -35,6 +43,12 @@ #include #include +#undef _EVENT_H_ +/* + This #undef exists here because both libc of NetWare and MySQL have + files named event.h which causes compilation errors. +*/ + #ifdef __cplusplus extern "C" { #endif @@ -65,6 +79,13 @@ extern "C" { #undef HAVE_STPCPY /* changes end */ +/* Changes made to make use of LibC-June-2005 for building purpose */ +#undef HAVE_GETPASS +#undef HAVE_GETRLIMIT +#undef HAVE_GETRUSAGE +#undef HAVE_INITGROUPS +/* Changes end - LibC-June-2005 */ + /* no libc crypt() function */ #ifdef HAVE_OPENSSL #define HAVE_CRYPT 1 diff --git a/netware/BUILD/compile-AUTOTOOLS b/netware/BUILD/compile-AUTOTOOLS index 57213b1b3d0..20e506aa683 100755 --- a/netware/BUILD/compile-AUTOTOOLS +++ b/netware/BUILD/compile-AUTOTOOLS @@ -6,7 +6,7 @@ # stop on errors set -e -for package in . ./innobase +for package in . ./storage/innobase do (cd $package rm -rf config.cache autom4te.cache diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools index fab92b8d4df..02c11998365 100755 --- a/netware/BUILD/compile-linux-tools +++ b/netware/BUILD/compile-linux-tools @@ -37,11 +37,11 @@ make (cd dbug; make libdbug.a) (cd strings; make libmystrings.a) (cd mysys; make libmysys.a) -(cd heap; make libheap.a) +(cd storage/heap; make libheap.a) (cd vio; make libvio.a) (cd regex; make libregex.a) -(cd myisam; make libmyisam.a) -(cd myisammrg; make libmyisammrg.a) +(cd storage/myisam; make libmyisam.a) +(cd storage/myisammrg; make libmyisammrg.a) (cd extra; make comp_err) (cd libmysql; make conf_to_src) (cd libmysql_r; make conf_to_src) @@ -57,7 +57,7 @@ make cp extra/comp_err extra/comp_err.linux cp libmysql/conf_to_src libmysql/conf_to_src.linux #cp libmysql_r/conf_to_src libmysql_r/conf_to_src.linux -cp sql/.libs/gen_lex_hash sql/gen_lex_hash.linux +cp sql/gen_lex_hash sql/gen_lex_hash.linux cp strings/conf_to_src strings/conf_to_src.linux # Delete mysql_version.h diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END index f7da0d9596e..0bb4e808b63 100755 --- a/netware/BUILD/compile-netware-END +++ b/netware/BUILD/compile-netware-END @@ -22,9 +22,8 @@ rm -rf Makefile.in.bk . $path/compile-AUTOTOOLS # For NetWare there is no comp_err but comp_err.linux -sed -e "s/comp_err/comp_err.linux/g" extra/Makefile.am > extra/Makefile.am.$$ -sed -e "s/replace comp_err.linux/replace comp_err/g" extra/Makefile.am.$$ > extra/Makefile.am -rm extra/Makefile.am.$$ +sed -e "s/comp_err\$(EXEEXT)/comp_err.linux/g" extra/Makefile.am > extra/Makefile.am.$$ +mv extra/Makefile.am.$$ extra/Makefile.am # configure ./configure $base_configs $extra_configs diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index fa52568fcd6..b88b6347668 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -4,10 +4,10 @@ # This values are normally changed by the nwbootstrap script # the default is "F:/mydev" -export MYDEV="F:/mydev" +export MYDEV=WINE_BUILD_DIR -export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/include;$MYDEV" -export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/openssl;$MYDEV/mysql-VERSION/netware/BUILD" +export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV/zlib-1.2.3;$MYDEV/mysql-VERSION/include;$MYDEV" +export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.2.3;$MYDEV/openssl;$MYDEV/mysql-VERSION/netware/BUILD" export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp" export WINEPATH="$MYDEV/mw/bin" diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index 48ff2a49667..22e1569e7ca 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -160,6 +160,11 @@ sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \ -e "s;VERSION;$version;g" $mwenv.org > $mwenv chmod +rwx $mwenv +PWD=`pwd` +SRC_DIR=`grep "^export MYDEV=" $mwenv | cut -d'=' -f2 | \ + sed -e 's;";;g' -e "s;^;echo ;g" -e "s;$;/\`basename $PWD\`;g" | /bin/sh` + + # edit the def file versions echo "updating *.def file versions..." nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"` @@ -167,13 +172,14 @@ nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1 for file in ./netware/*.def do mv -f $file $file.org - sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file + sed -e "s;VERSION.*;VERSION $nlm_version;g" \ + -e "s;XDCDATA.*;XDCDATA $SRC_DIR/netware/mysql.xdc;g" $file.org > $file rm $file.org done # create the libmysql.imp file in netware folder from libmysql/libmysql.def # file -echo "generating llibmysql.imp file..." +echo "generating libmysql.imp file..." awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp # build linux tools echo "compiling linux tools..." diff --git a/netware/Makefile.am b/netware/Makefile.am index fdf4023aef2..e1c2eedc2b7 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -30,13 +30,16 @@ netware_build_files = client/mysql.def client/mysqladmin.def \ client/mysqldump.def client/mysqlimport.def \ client/mysqlshow.def client/mysqltest.def \ client/mysqlslap.def \ + sql/mysqld.def extra/mysql_waitpid.def \ extra/mysql_install.def extra/my_print_defaults.def \ extra/perror.def extra/replace.def \ extra/resolveip.def extra/comp_err.def \ - libmysqld/libmysqld.def myisam/myisamchk.def \ - myisam/myisamlog.def myisam/myisampack.def \ - sql/mysqld.def extra/mysql_waitpid.def \ - extra/resolve_stack_dump.def myisam/myisam_ftdump.def + extra/resolve_stack_dump.def \ + libmysqld/libmysqld.def \ + storage/myisam/myisamchk.def \ + storage/myisam/myisamlog.def \ + storage/myisam/myisampack.def \ + storage/myisam/myisam_ftdump.def link_sources: set -x; \ diff --git a/netware/my_manage.h b/netware/my_manage.h index 480eefbe55a..360f2f104be 100644 --- a/netware/my_manage.h +++ b/netware/my_manage.h @@ -54,7 +54,8 @@ bool skip_first_param; #define ARG_BUF 10 -#define TRY_MAX 5 +#define TRY_MAX 5 +#define NULL (char) 0 #ifdef __NETWARE__ #define strstr(A,B) strindex(A,B) diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index 6bab2f0149c..9b02f897a60 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -1189,7 +1189,7 @@ void setup(char *file) ******************************************************************************/ int main(int argc, char **argv) { - int is_ignore_list = 0; + int is_ignore_list= 0, autoclose= 0, individual_execution= 0; // setup setup(argv[0]); @@ -1236,16 +1236,22 @@ int main(int argc, char **argv) { int i; - // single test - single_test = TRUE; - for (i = 1 + is_ignore_list; i < argc; i++) { + if (!strncasecmp(argv[i], "--autoclose", 11)) + { + autoclose= 1; + continue; + } + // single test + single_test= TRUE; + individual_execution= 1; + // run given test run_test(argv[i]); } } - else + if (!individual_execution) { // run all tests DIR *dir = opendir(test_dir); @@ -1297,7 +1303,8 @@ int main(int argc, char **argv) if (log_fd) fclose(log_fd); // keep results up - pressanykey(); + if (!autoclose) + pressanykey(); return 0; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7f09b2526c7..46385905788 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -134,6 +134,13 @@ int deny_severity = LOG_WARNING; #define zVOLSTATE_DEACTIVE 2 #define zVOLSTATE_MAINTENANCE 3 +#undef __event_h__ +#include <../include/event.h> +/* + This #undef exists here because both libc of NetWare and MySQL have + files named event.h which causes compilation errors. +*/ + #include #include #include @@ -3323,6 +3330,10 @@ server."); mysql_bin_log.purge_logs_before_date(purge_time); } #endif +#ifdef __NETWARE__ + /* Increasing stacksize of threads on NetWare */ + pthread_attr_setstacksize(&connection_attrib, NW_THD_STACKSIZE); +#endif if (opt_myisam_log) (void) mi_log(1); @@ -3556,7 +3567,6 @@ int main(int argc, char **argv) #endif #ifdef __NETWARE__ /* Increasing stacksize of threads on NetWare */ - pthread_attr_setstacksize(&connection_attrib, NW_THD_STACKSIZE); #endif diff --git a/sql/set_var.cc b/sql/set_var.cc index 1a86cd1aef7..fd54d5a2916 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -215,8 +215,9 @@ sys_var_long_ptr sys_delayed_insert_timeout("delayed_insert_timeout", &delayed_insert_timeout); sys_var_long_ptr sys_delayed_queue_size("delayed_queue_size", &delayed_queue_size); -sys_var_event_executor sys_event_executor("event_scheduler", - (my_bool *)&event_executor_running_global_var); +sys_var_event_executor sys_event_executor("event_scheduler", + (my_bool *) + &event_executor_running_global_var); sys_var_long_ptr sys_expire_logs_days("expire_logs_days", &expire_logs_days); sys_var_bool_ptr sys_flush("flush", &myisam_flush); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 959e4912c1c..5833842f660 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2264,6 +2264,7 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id, return pending; /* This is the current pending event */ } +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION /* Instansiate the versions we need, we have -fno-implicit-template as compiling option. @@ -2282,6 +2283,7 @@ template Rows_log_event* THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*, my_size_t colcnt, my_size_t, bool, Update_rows_log_event *); +#endif static char const* field_type_name(enum_field_types type) { diff --git a/storage/innobase/os/os0thread.c b/storage/innobase/os/os0thread.c index 1d1cb77b336..c0e66ff2b7e 100644 --- a/storage/innobase/os/os0thread.c +++ b/storage/innobase/os/os0thread.c @@ -156,6 +156,15 @@ os_thread_create( "InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret); exit(1); } +#endif +#ifdef __NETWARE__ + ret = pthread_attr_setstacksize(&attr, + (size_t)NW_THD_STACKSIZE); + if (ret) { + fprintf(stderr, + "InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret); + exit(1); + } #endif os_mutex_enter(os_sync_mutex); os_thread_count++; diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index c7f8c8d6e7f..7c418cb9531 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -84,14 +84,16 @@ int mi_lock_database(MI_INFO *info, int lock_type) (uint) share->changed, share->w_locks)); if (share->changed && !share->w_locks) { - if (info->s->mmaped_length != info->s->state.state.data_file_length) - { - if (info->s->concurrent_insert) - rw_wrlock(&info->s->mmap_lock); - mi_remap_file(info, info->s->state.state.data_file_length); - if (info->s->concurrent_insert) - rw_unlock(&info->s->mmap_lock); - } +#ifdef HAVE_MMAP + if (info->s->mmaped_length != info->s->state.state.data_file_length) + { + if (info->s->concurrent_insert) + rw_wrlock(&info->s->mmap_lock); + mi_remap_file(info, info->s->state.state.data_file_length); + if (info->s->concurrent_insert) + rw_unlock(&info->s->mmap_lock); + } +#endif share->state.process= share->last_process=share->this_process; share->state.unique= info->last_unique= info->this_unique; share->state.update_count= info->last_loop= ++info->this_loop;