Commit eb968344 authored by kent@mysql.com's avatar kent@mysql.com

Merge

parents 38108ee6 6c464815
...@@ -1905,7 +1905,7 @@ EOF ...@@ -1905,7 +1905,7 @@ EOF
; ;
print OUT "nonguarded\n" if $instance->{'nonguarded'}; 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"; print OUT "\n";
} }
......
...@@ -21,7 +21,7 @@ skip-stack-trace VALUE ...@@ -21,7 +21,7 @@ skip-stack-trace VALUE
skip-innodb VALUE skip-innodb VALUE
skip-bdb VALUE skip-bdb VALUE
skip-ndbcluster VALUE skip-ndbcluster VALUE
old-log-format VALUE log-output VALUE
SHOW INSTANCE OPTIONS mysqld2; SHOW INSTANCE OPTIONS mysqld2;
option_name value option_name value
instance_name VALUE instance_name VALUE
...@@ -42,7 +42,7 @@ skip-stack-trace VALUE ...@@ -42,7 +42,7 @@ skip-stack-trace VALUE
skip-innodb VALUE skip-innodb VALUE
skip-bdb VALUE skip-bdb VALUE
skip-ndbcluster VALUE skip-ndbcluster VALUE
old-log-format VALUE log-output VALUE
START INSTANCE mysqld2; START INSTANCE mysqld2;
STOP INSTANCE mysqld2; STOP INSTANCE mysqld2;
SHOW mysqld1 LOG FILES; SHOW mysqld1 LOG FILES;
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
# 5. check that the slave and master BANK databases are the same # 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.inc
--source include/have_ndb_extra.inc --source include/have_ndb_extra.inc
--source include/have_binlog_format_row.inc --source include/have_binlog_format_row.inc
--source include/master-slave.inc --source include/master-slave.inc
# kill any trailing processes
--system killall lt-bankTransactionMaker lt-bankTimer lt-bankMakeGL || true
--disable_warnings --disable_warnings
# initialize master # initialize master
--connection master --connection master
......
...@@ -131,7 +131,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ ...@@ -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 \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \
storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \
storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$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 \ server-tools/instance-manager/mysqlmanager$BS \
client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \
client/mysqlslap$BS \ client/mysqlslap$BS \
...@@ -173,8 +173,9 @@ if [ x$STRIP = x1 ] ; then ...@@ -173,8 +173,9 @@ if [ x$STRIP = x1 ] ; then
strip $BASE/bin/* strip $BASE/bin/*
fi fi
# Copy not binary files # Obsolete, starting from 5.1.6-beta
copyfileto $BASE/bin sql/mysqld.sym.gz # # Copy not binary files
# copyfileto $BASE/bin sql/mysqld.sym.gz
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
$CP netware/*.pl $BASE/scripts $CP netware/*.pl $BASE/scripts
...@@ -304,11 +305,12 @@ else ...@@ -304,11 +305,12 @@ else
rm -f $BASE/README.NW rm -f $BASE/README.NW
fi fi
# Make safe_mysqld a symlink to mysqld_safe for backwards portability # Dropped with 5.1.6-beta
# To be removed in MySQL 4.1 # # Make safe_mysqld a symlink to mysqld_safe for backwards portability
if [ $BASE_SYSTEM != "netware" ] ; then # # To be removed in MySQL 4.1
(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) # if [ $BASE_SYSTEM != "netware" ] ; then
fi # (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
# fi
# Clean up if we did this from a bk tree # Clean up if we did this from a bk tree
if [ -d $BASE/sql-bench/SCCS ] ; then if [ -d $BASE/sql-bench/SCCS ] ; then
......
...@@ -77,7 +77,8 @@ mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \ ...@@ -77,7 +77,8 @@ mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \
mysql_manager_error.h \ mysql_manager_error.h \
portability.h portability.h
mysqlmanager_LDADD= liboptions.a \ mysqlmanager_LDADD= @CLIENT_EXTRA_LDFLAGS@ \
liboptions.a \
libnet.a \ libnet.a \
$(top_builddir)/vio/libvio.a \ $(top_builddir)/vio/libvio.a \
$(top_builddir)/mysys/libmysys.a \ $(top_builddir)/mysys/libmysys.a \
......
...@@ -610,7 +610,7 @@ void LOGGER::init_base() ...@@ -610,7 +610,7 @@ void LOGGER::init_base()
file_log_handler= new Log_to_file_event_handler; file_log_handler= new Log_to_file_event_handler;
/* by default we use traditional error log */ /* by default we use traditional error log */
init_error_log(LEGACY); init_error_log(LOG_FILE);
file_log_handler->init_pthread_objects(); file_log_handler->init_pthread_objects();
(void) pthread_mutex_init(&LOCK_logger, MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_logger, MY_MUTEX_INIT_SLOW);
...@@ -819,41 +819,47 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command, ...@@ -819,41 +819,47 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command,
return error; 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) { if (error_log_printer & LOG_NONE)
case NONE: {
error_log_handler_list[0]= 0; error_log_handler_list[0]= 0;
break; return;
case LEGACY: }
switch (error_log_printer) {
case LOG_FILE:
error_log_handler_list[0]= file_log_handler; error_log_handler_list[0]= file_log_handler;
error_log_handler_list[1]= 0; error_log_handler_list[1]= 0;
break; break;
/* these two are disabled for now */ /* these two are disabled for now */
case CSV: case LOG_TABLE:
DBUG_ASSERT(0); DBUG_ASSERT(0);
break; break;
case LEGACY_AND_CSV: case LOG_TABLE|LOG_FILE:
DBUG_ASSERT(0); DBUG_ASSERT(0);
break; 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) { if (slow_log_printer & LOG_NONE)
case NONE: {
slow_log_handler_list[0]= 0; slow_log_handler_list[0]= 0;
break; return;
case LEGACY: }
switch (slow_log_printer) {
case LOG_FILE:
slow_log_handler_list[0]= file_log_handler; slow_log_handler_list[0]= file_log_handler;
slow_log_handler_list[1]= 0; slow_log_handler_list[1]= 0;
break; break;
case CSV: case LOG_TABLE:
slow_log_handler_list[0]= table_log_handler; slow_log_handler_list[0]= table_log_handler;
slow_log_handler_list[1]= 0; slow_log_handler_list[1]= 0;
break; break;
case LEGACY_AND_CSV: case LOG_TABLE|LOG_FILE:
slow_log_handler_list[0]= file_log_handler; slow_log_handler_list[0]= file_log_handler;
slow_log_handler_list[1]= table_log_handler; slow_log_handler_list[1]= table_log_handler;
slow_log_handler_list[2]= 0; slow_log_handler_list[2]= 0;
...@@ -861,21 +867,24 @@ void LOGGER::init_slow_log(enum enum_printer slow_log_printer) ...@@ -861,21 +867,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) { if (general_log_printer & LOG_NONE)
case NONE: {
general_log_handler_list[0]= 0; general_log_handler_list[0]= 0;
break; return;
case LEGACY: }
switch (general_log_printer) {
case LOG_FILE:
general_log_handler_list[0]= file_log_handler; general_log_handler_list[0]= file_log_handler;
general_log_handler_list[1]= 0; general_log_handler_list[1]= 0;
break; break;
case CSV: case LOG_TABLE:
general_log_handler_list[0]= table_log_handler; general_log_handler_list[0]= table_log_handler;
general_log_handler_list[1]= 0; general_log_handler_list[1]= 0;
break; break;
case LEGACY_AND_CSV: case LOG_TABLE|LOG_FILE:
general_log_handler_list[0]= file_log_handler; general_log_handler_list[0]= file_log_handler;
general_log_handler_list[1]= table_log_handler; general_log_handler_list[1]= table_log_handler;
general_log_handler_list[2]= 0; general_log_handler_list[2]= 0;
...@@ -906,20 +915,20 @@ bool Log_to_csv_event_handler::init() ...@@ -906,20 +915,20 @@ bool Log_to_csv_event_handler::init()
return (open_log_table(QUERY_LOG_GENERAL) || open_log_table(QUERY_LOG_SLOW)); return (open_log_table(QUERY_LOG_GENERAL) || open_log_table(QUERY_LOG_SLOW));
} }
int LOGGER::set_handlers(enum enum_printer error_log_printer, int LOGGER::set_handlers(uint error_log_printer,
enum enum_printer slow_log_printer, uint slow_log_printer,
enum enum_printer general_log_printer) uint general_log_printer)
{ {
/* error log table is not supported yet */ /* error log table is not supported yet */
DBUG_ASSERT(error_log_printer < CSV); DBUG_ASSERT(error_log_printer < LOG_TABLE);
lock(); 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) !is_log_tables_initialized)
{ {
slow_log_printer= LEGACY; slow_log_printer= (slow_log_printer & ~LOG_TABLE) | LOG_FILE;
general_log_printer= LEGACY; general_log_printer= (general_log_printer & ~LOG_TABLE) | LOG_FILE;
sql_print_error("Failed to initialize log tables. " sql_print_error("Failed to initialize log tables. "
"Falling back to the old-fashioned logs"); "Falling back to the old-fashioned logs");
......
...@@ -138,14 +138,10 @@ typedef struct st_log_info ...@@ -138,14 +138,10 @@ typedef struct st_log_info
*/ */
#define MAX_LOG_HANDLERS_NUM 3 #define MAX_LOG_HANDLERS_NUM 3
enum enum_printer /* log event handler flags */
{ #define LOG_NONE 1
NONE, #define LOG_FILE 2
LEGACY, #define LOG_TABLE 4
CSV,
LEGACY_AND_CSV
};
class Log_event; class Log_event;
class Rows_log_event; class Rows_log_event;
...@@ -503,12 +499,12 @@ public: ...@@ -503,12 +499,12 @@ public:
bool reopen_log_table(uint log_type); bool reopen_log_table(uint log_type);
/* we use this function to setup all enabled log event handlers */ /* we use this function to setup all enabled log event handlers */
int set_handlers(enum enum_printer error_log_printer, int set_handlers(uint error_log_printer,
enum enum_printer slow_log_printer, uint slow_log_printer,
enum enum_printer general_log_printer); uint general_log_printer);
void init_error_log(enum enum_printer error_log_printer); void init_error_log(uint error_log_printer);
void init_slow_log(enum enum_printer slow_log_printer); void init_slow_log(uint slow_log_printer);
void init_general_log(enum enum_printer general_log_printer); void init_general_log(uint general_log_printer);
}; };
#endif /* LOG_H */ #endif /* LOG_H */
...@@ -1305,7 +1305,6 @@ extern my_bool locked_in_memory; ...@@ -1305,7 +1305,6 @@ extern my_bool locked_in_memory;
extern bool opt_using_transactions, mysqld_embedded; extern bool opt_using_transactions, mysqld_embedded;
extern bool using_update_log, opt_large_files, server_id_supplied; 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_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 bool opt_disable_networking, opt_skip_show_db;
extern my_bool opt_character_set_client_handshake; extern my_bool opt_character_set_client_handshake;
extern bool volatile abort_loop, shutdown_in_progress, grant_option; extern bool volatile abort_loop, shutdown_in_progress, grant_option;
......
...@@ -304,8 +304,16 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] = ...@@ -304,8 +304,16 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] =
{&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}, {&Arg_comparator::compare_row, &Arg_comparator::compare_e_row},
{&Arg_comparator::compare_decimal, &Arg_comparator::compare_e_decimal}}; {&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 */ /* 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 lower_case_table_names_used= 0;
static bool volatile select_thread_in_use, signal_thread_in_use; static bool volatile select_thread_in_use, signal_thread_in_use;
static bool volatile ready_to_exit; static bool volatile ready_to_exit;
...@@ -339,9 +347,6 @@ static my_bool opt_sync_bdb_logs; ...@@ -339,9 +347,6 @@ static my_bool opt_sync_bdb_logs;
bool opt_log, opt_update_log, opt_bin_log, opt_slow_log; bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
bool opt_error_log= IF_WIN(1,0); 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; bool opt_disable_networking=0, opt_skip_show_db=0;
my_bool opt_character_set_client_handshake= 1; my_bool opt_character_set_client_handshake= 1;
bool server_id_supplied = 0; bool server_id_supplied = 0;
...@@ -2402,8 +2407,8 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) ...@@ -2402,8 +2407,8 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
sql_print_information("Got signal %d to shutdown mysqld",sig); sql_print_information("Got signal %d to shutdown mysqld",sig);
#endif #endif
/* switch to the old log message processing */ /* switch to the old log message processing */
logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE, logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_FILE:LOG_NONE,
opt_log ? LEGACY:NONE); opt_log ? LOG_FILE:LOG_NONE);
DBUG_PRINT("info",("Got signal: %d abort_loop: %d",sig,abort_loop)); DBUG_PRINT("info",("Got signal: %d abort_loop: %d",sig,abort_loop));
if (!abort_loop) if (!abort_loop)
{ {
...@@ -2432,8 +2437,8 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) ...@@ -2432,8 +2437,8 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
(TABLE_LIST*) 0, &not_used); // Flush logs (TABLE_LIST*) 0, &not_used); // Flush logs
} }
/* reenable logs after the options were reloaded */ /* reenable logs after the options were reloaded */
logger.set_handlers(LEGACY, opt_slow_log ? CSV:NONE, logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_TABLE:LOG_NONE,
opt_log ? CSV:NONE); opt_log ? LOG_TABLE:LOG_NONE);
break; break;
#ifdef USE_ONE_SIGNAL_HAND #ifdef USE_ONE_SIGNAL_HAND
case THR_SERVER_ALARM: case THR_SERVER_ALARM:
...@@ -3091,25 +3096,38 @@ static int init_server_components() ...@@ -3091,25 +3096,38 @@ static int init_server_components()
#ifdef WITH_CSV_STORAGE_ENGINE #ifdef WITH_CSV_STORAGE_ENGINE
if (opt_bootstrap) if (opt_bootstrap)
opt_old_log_format= TRUE; log_output_options= LOG_FILE;
else else
logger.init_log_tables(); logger.init_log_tables();
if (opt_old_log_format || (have_csv_db != SHOW_OPTION_YES)) if (log_output_options & LOG_NONE)
logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE, {
opt_log ? LEGACY: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 else
if (opt_both_log_formats) {
logger.set_handlers(LEGACY, /* fall back to the log files if tables are not present */
opt_slow_log ? LEGACY_AND_CSV:NONE, if (have_csv_db == SHOW_OPTION_NO)
opt_log ? LEGACY_AND_CSV:NONE); {
else sql_print_error("CSV engine is not present, falling back to the "
/* the default is CSV log tables */ "log files");
logger.set_handlers(LEGACY, opt_slow_log ? CSV:NONE, log_output_options= log_output_options & ~LOG_TABLE | LOG_FILE;
opt_log ? CSV:NONE); }
logger.set_handlers(LOG_FILE, opt_slow_log ? log_output_options:LOG_NONE,
opt_log ? log_output_options:LOG_NONE);
}
#else #else
logger.set_handlers(LEGACY, opt_slow_log ? LEGACY:NONE, logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_FILE:LOG_NONE,
opt_log ? LEGACY:NONE); opt_log ? LOG_FILE:LOG_NONE);
#endif #endif
if (opt_update_log) if (opt_update_log)
...@@ -4689,7 +4707,7 @@ enum options_mysqld ...@@ -4689,7 +4707,7 @@ enum options_mysqld
OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE, OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE,
OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID, OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID,
OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER, OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER,
OPT_ABORT_SLAVE_EVENT_COUNT, OPT_OLD_LOG_FORMAT, OPT_BOTH_LOG_FORMATS, OPT_ABORT_SLAVE_EVENT_COUNT,
OPT_INNODB_DATA_HOME_DIR, OPT_INNODB_DATA_HOME_DIR,
OPT_INNODB_DATA_FILE_PATH, OPT_INNODB_DATA_FILE_PATH,
OPT_INNODB_LOG_GROUP_HOME_DIR, OPT_INNODB_LOG_GROUP_HOME_DIR,
...@@ -4832,6 +4850,7 @@ enum options_mysqld ...@@ -4832,6 +4850,7 @@ enum options_mysqld
OPT_LOG_SLOW_ADMIN_STATEMENTS, OPT_LOG_SLOW_ADMIN_STATEMENTS,
OPT_TABLE_LOCK_WAIT_TIMEOUT, OPT_TABLE_LOCK_WAIT_TIMEOUT,
OPT_PLUGIN_DIR, OPT_PLUGIN_DIR,
OPT_LOG_OUTPUT,
OPT_PORT_OPEN_TIMEOUT OPT_PORT_OPEN_TIMEOUT
}; };
...@@ -5230,6 +5249,13 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, ...@@ -5230,6 +5249,13 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
{"log-long-format", '0', {"log-long-format", '0',
"Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.", "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}, 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[=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},
#endif
{"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES, {"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.", "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, (gptr*) &opt_log_queries_not_using_indexes, (gptr*) &opt_log_queries_not_using_indexes,
...@@ -5251,16 +5277,6 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, ...@@ -5251,16 +5277,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.", "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, (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0}, 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, {"log-tc", OPT_LOG_TC,
"Path to transaction coordinator log (used for transactions that affect " "Path to transaction coordinator log (used for transactions that affect "
"more than one storage engine, when binary log is disabled)", "more than one storage engine, when binary log is disabled)",
...@@ -6954,10 +6970,6 @@ static void mysql_init_variables(void) ...@@ -6954,10 +6970,6 @@ static void mysql_init_variables(void)
opt_skip_slave_start= opt_reckless_slave = 0; opt_skip_slave_start= opt_reckless_slave = 0;
mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0; mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0;
opt_log= opt_update_log= opt_slow_log= 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_bin_log= 0;
opt_disable_networking= opt_skip_show_db=0; opt_disable_networking= opt_skip_show_db=0;
opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0; opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0;
...@@ -7366,12 +7378,25 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -7366,12 +7378,25 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_slow_log= 1; opt_slow_log= 1;
break; break;
#ifdef WITH_CSV_STORAGE_ENGINE #ifdef WITH_CSV_STORAGE_ENGINE
case (int) OPT_OLD_LOG_FORMAT: case OPT_LOG_OUTPUT:
opt_old_log_format= 1; {
break; if (!argument || !argument[0])
case (int) OPT_BOTH_LOG_FORMATS: {
opt_both_log_formats= 1; 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; break;
}
#endif #endif
case (int) OPT_SKIP_NEW: case (int) OPT_SKIP_NEW:
opt_specialflag|= SPECIAL_NO_NEW_FUNC; opt_specialflag|= SPECIAL_NO_NEW_FUNC;
......
...@@ -345,7 +345,7 @@ struct st_plugin_int *plugin_lock(LEX_STRING *name, int type) ...@@ -345,7 +345,7 @@ struct st_plugin_int *plugin_lock(LEX_STRING *name, int type)
rw_wrlock(&THR_LOCK_plugin); rw_wrlock(&THR_LOCK_plugin);
if ((rc= plugin_find_internal(name, type))) 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++; rc->ref_count++;
else else
rc= 0; rc= 0;
......
...@@ -126,14 +126,8 @@ by one. */ ...@@ -126,14 +126,8 @@ by one. */
#ifdef __WIN__ #ifdef __WIN__
#define UNIV_INLINE __inline #define UNIV_INLINE __inline
#else #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 #define UNIV_INLINE static inline
#endif #endif
#endif
#else #else
/* If we want to compile a noninlined version we use the following macro /* If we want to compile a noninlined version we use the following macro
......
...@@ -38,7 +38,7 @@ libblocks_a_SOURCES = tsman.cpp lgman.cpp pgman.cpp diskpage.cpp restore.cpp\ ...@@ -38,7 +38,7 @@ libblocks_a_SOURCES = tsman.cpp lgman.cpp pgman.cpp diskpage.cpp restore.cpp\
dbtux/DbtuxSearch.cpp dbtux/DbtuxCmp.cpp dbtux/DbtuxStat.cpp \ dbtux/DbtuxSearch.cpp dbtux/DbtuxCmp.cpp dbtux/DbtuxStat.cpp \
dbtux/DbtuxDebug.cpp dbtux/DbtuxDebug.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_SOURCES = print_file.cpp diskpage.cpp dbtup/tuppage.cpp
ndb_print_file_LDFLAGS = @ndb_bin_am_ldflags@ \ ndb_print_file_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)/storage/ndb/src/libndbclient.la \ $(top_builddir)/storage/ndb/src/libndbclient.la \
......
...@@ -5,7 +5,7 @@ include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am ...@@ -5,7 +5,7 @@ include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
ndbtest_PROGRAMS = test_varpage EXTRA_PROGRAMS = test_varpage
test_varpage_SOURCES = test_varpage.cpp tuppage.cpp test_varpage_SOURCES = test_varpage.cpp tuppage.cpp
test_varpage_LDFLAGS = @ndb_bin_am_ldflags@ \ test_varpage_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)/storage/ndb/src/libndbclient.la \ $(top_builddir)/storage/ndb/src/libndbclient.la \
......
...@@ -114,8 +114,6 @@ Group: Applications/Databases ...@@ -114,8 +114,6 @@ Group: Applications/Databases
This package contains the ndbcluster storage engine. This package contains the ndbcluster storage engine.
It is necessary to have this package installed on all It is necessary to have this package installed on all
computers that should store ndbcluster table data. 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} %{see_base}
...@@ -181,29 +179,6 @@ Group: Applications/Databases ...@@ -181,29 +179,6 @@ Group: Applications/Databases
This package contains the shared libraries (*.so*) which certain This package contains the shared libraries (*.so*) which certain
languages and applications need to dynamically load and use MySQL. 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 %package embedded
Requires: %{name}-devel Requires: %{name}-devel
Summary: MySQL - embedded library Summary: MySQL - embedded library
...@@ -224,7 +199,11 @@ client/server version. ...@@ -224,7 +199,11 @@ client/server version.
%{see_base} %{see_base}
%prep %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 %build
...@@ -234,12 +213,13 @@ BuildMySQL() { ...@@ -234,12 +213,13 @@ BuildMySQL() {
sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
CC=\"${CC:-$MYSQL_BUILD_CC}\" \ CC=\"${CC:-$MYSQL_BUILD_CC}\" \
CXX=\"${CXX:-$MYSQL_BUILD_CXX}\" \ CXX=\"${CXX:-$MYSQL_BUILD_CXX}\" \
CFLAGS=\"${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS}\" \ CFLAGS=\"$CFLAGS\" \
CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS \ CXXFLAGS=\"$CXXFLAGS\" \
-felide-constructors -fno-exceptions -fno-rtti \
}\" \
./configure \ ./configure \
$* \ $* \
--with-mysqld-ldflags='-static' \
--with-client-ldflags='-static' \
--with-zlib-dir=bundled \
--enable-assembler \ --enable-assembler \
--enable-local-infile \ --enable-local-infile \
--with-mysqld-user=%{mysqld_user} \ --with-mysqld-user=%{mysqld_user} \
...@@ -280,7 +260,6 @@ fi ...@@ -280,7 +260,6 @@ fi
# Use the build root for temporary storage of the shared libraries. # Use the build root for temporary storage of the shared libraries.
RBR=$RPM_BUILD_ROOT RBR=$RPM_BUILD_ROOT
MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
# Clean up the BuildRoot first # Clean up the BuildRoot first
[ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR; [ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR;
...@@ -292,8 +271,7 @@ mkdir -p $RBR%{_libdir}/mysql ...@@ -292,8 +271,7 @@ mkdir -p $RBR%{_libdir}/mysql
PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin} PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin}
export PATH export PATH
# Build the Max binary (includes BDB and UDFs and therefore # Build the Debug binary.
# cannot be linked statically against the patched glibc)
# Use gcc for C and C++ code (to avoid a dependency on libstdc++ and # Use gcc for C and C++ code (to avoid a dependency on libstdc++ and
# including exceptions into the code # including exceptions into the code
...@@ -303,7 +281,12 @@ then ...@@ -303,7 +281,12 @@ then
export CXX="gcc" export CXX="gcc"
fi 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 \ BuildMySQL "--enable-shared \
--with-debug \
--with-berkeley-db \ --with-berkeley-db \
--with-innodb \ --with-innodb \
--with-ndbcluster \ --with-ndbcluster \
...@@ -313,86 +296,43 @@ BuildMySQL "--enable-shared \ ...@@ -313,86 +296,43 @@ BuildMySQL "--enable-shared \
--with-blackhole-storage-engine \ --with-blackhole-storage-engine \
--with-federated-storage-engine \ --with-federated-storage-engine \
--with-big-tables \ --with-big-tables \
--with-comment=\"MySQL Community Edition - Experimental (GPL)\" \ --with-comment=\"MySQL Community Edition - Debug (GPL)\"")
--with-server-suffix='-max'"
# We might want to save the config log file # We might want to save the config log file
if test -n "$MYSQL_MAXCONFLOG_DEST" if test -n "$MYSQL_DEBUGCONFLOG_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 then
libgcc=`$CC --print-libgcc-file` cp -fp mysql-debug-%{mysql_version}/config.log "$MYSQL_DEBUGCONFLOG_DEST"
if [ -f $libgcc ]
then
%define have_libgcc 1
install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a
fi
fi fi
# Save libraries (cd mysql-debug-%{mysql_version} && make test-force) || true
(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 # Build release binary.
make clean (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" \
# Only link statically on our i386 build host (which has a specially BuildMySQL "--enable-shared \
# patched static glibc installed) - ia64 and x86_64 run glibc-2.3 (unpatched) --with-berkeley-db \
# 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-innodb \
--with-big-tables" --with-ndbcluster \
if test -f sql/.libs/mysqld --with-archive-storage-engine \
then --with-csv-storage-engine \
nm --numeric-sort sql/.libs/mysqld > sql/mysqld.sym --with-example-storage-engine \
else --with-blackhole-storage-engine \
nm --numeric-sort sql/mysqld > sql/mysqld.sym --with-federated-storage-engine \
fi --with-big-tables \
--with-comment=\"MySQL Community Edition (GPL)\"")
# We might want to save the config log file # We might want to save the config log file
if test -n "$MYSQL_CONFLOG_DEST" if test -n "$MYSQL_CONFLOG_DEST"
then then
cp -fp config.log "$MYSQL_CONFLOG_DEST" cp -fp mysql-release-%{mysql_version}/config.log "$MYSQL_CONFLOG_DEST"
fi fi
make test-force || true (cd mysql-release-%{mysql_version} && make test-force) || true
%install %install
RBR=$RPM_BUILD_ROOT 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 # Ensure that needed directories exists
install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} install -d $RBR%{_sysconfdir}/{logrotate.d,init.d}
...@@ -404,21 +344,22 @@ install -d $RBR%{_mandir} ...@@ -404,21 +344,22 @@ install -d $RBR%{_mandir}
install -d $RBR%{_sbindir} install -d $RBR%{_sbindir}
# Install all binaries stripped # Install all binaries
make install-strip DESTDIR=$RBR benchdir_root=%{_datadir} (cd $MBD && make install DESTDIR=$RBR benchdir_root=%{_datadir})
# Old packages put shared libs in %{_libdir}/ (not %{_libdir}/mysql), so do
# Install shared libraries (Disable for architectures that don't support it) # the same here.
(cd $RBR%{_libdir}; tar xf $RBR/shared-libs.tar; rm -f $RBR/shared-libs.tar) mv $RBR/%{_libdir}/mysql/*.so* $RBR/%{_libdir}/
# install saved mysqld-max # install mysqld-debug
install -s -m 755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max 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 saved perror binary with NDB support (BUG#13740)
install -s -m 755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror install -m 755 $MBD/extra/perror $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 logrotate and autostart # Install logrotate and autostart
install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
...@@ -510,11 +451,6 @@ mysql_clusterdir=/var/lib/mysql-cluster ...@@ -510,11 +451,6 @@ mysql_clusterdir=/var/lib/mysql-cluster
if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi 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 %preun server
if test $1 = 0 if test $1 = 0
then then
...@@ -546,9 +482,9 @@ fi ...@@ -546,9 +482,9 @@ fi
%files server %files server
%defattr(-,root,root,0755) %defattr(-,root,root,0755)
%doc COPYING README %doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README
%doc support-files/my-*.cnf %doc mysql-release-%{mysql_version}/support-files/my-*.cnf
%doc support-files/ndb-*.ini %doc mysql-release-%{mysql_version}/support-files/ndb-*.ini
%doc %attr(644, root, root) %{_infodir}/mysql.info* %doc %attr(644, root, root) %{_infodir}/mysql.info*
...@@ -597,9 +533,9 @@ fi ...@@ -597,9 +533,9 @@ fi
%attr(755, root, root) %{_bindir}/safe_mysqld %attr(755, root, root) %{_bindir}/safe_mysqld
%attr(755, root, root) %{_sbindir}/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}/mysqlmanager
%attr(755, root, root) %{_sbindir}/rcmysql %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(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
%attr(755, root, root) %{_sysconfdir}/init.d/mysql %attr(755, root, root) %{_sysconfdir}/init.d/mysql
...@@ -631,6 +567,7 @@ fi ...@@ -631,6 +567,7 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1* %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/mysqlimport.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1*
%post shared %post shared
/sbin/ldconfig /sbin/ldconfig
...@@ -666,7 +603,7 @@ fi ...@@ -666,7 +603,7 @@ fi
%files devel %files devel
%defattr(-, root, root, 0755) %defattr(-, root, root, 0755)
%doc EXCEPTIONS-CLIENT %doc mysql-release-%{mysql_version}/EXCEPTIONS-CLIENT
%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
%attr(755, root, root) %{_bindir}/comp_err %attr(755, root, root) %{_bindir}/comp_err
%attr(755, root, root) %{_bindir}/mysql_config %attr(755, root, root) %{_bindir}/mysql_config
...@@ -675,9 +612,6 @@ fi ...@@ -675,9 +612,6 @@ fi
%{_includedir}/mysql/* %{_includedir}/mysql/*
%{_libdir}/mysql/libdbug.a %{_libdir}/mysql/libdbug.a
%{_libdir}/mysql/libheap.a %{_libdir}/mysql/libheap.a
%if %{have_libgcc}
%{_libdir}/mysql/libmygcc.a
%endif
%{_libdir}/mysql/libmyisam.a %{_libdir}/mysql/libmyisam.a
%{_libdir}/mysql/libmyisammrg.a %{_libdir}/mysql/libmyisammrg.a
%{_libdir}/mysql/libmysqlclient.a %{_libdir}/mysql/libmysqlclient.a
...@@ -706,11 +640,6 @@ fi ...@@ -706,11 +640,6 @@ fi
%attr(755, root, root) %{_bindir}/mysqltestmanager-pwgen %attr(755, root, root) %{_bindir}/mysqltestmanager-pwgen
%attr(755, root, root) %{_bindir}/mysqltestmanagerc %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 %files embedded
%defattr(-, root, root, 0755) %defattr(-, root, root, 0755)
# %attr(644, root, root) %{_libdir}/mysql/libmysqld.a # %attr(644, root, root) %{_libdir}/mysql/libmysqld.a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment