mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
LOAD DATA INFILE is now replicated properly, except for cleanup on
Stop event and bugs the test suite could not catch Did some big restructuring of binlog event classes - most important change is that now each event class has exec_event method and one does not need to modify slave core code to add a new event. Slave code is now much smaller and easier to read include/my_sys.h: pre_code and arg in IO_CACHE mysql-test/r/rpl_log.result: updated result for LOAD DATA INFILE fix mysys/mf_iocache.c: pre_close routine and arg pointer for callback magic sql/log.cc: changed MYSQL_LOG so that write() method is for generic Log_event - removed redundant code sql/log_event.cc: added classes for file events added exec_event() method to all classes restructured/cleaned up event classes sql/log_event.h: added classes for file events added exec_event() method to all classes restructured/cleaned up event classes sql/mf_iocache.cc: pre_close/arg sql/mysqld.cc: added slave-load-tmpdir and old-rpl-compat options sql/slave.cc: changed exec_event() to use Log_event::exec_event() some routines are now needed in log_event.cc and cannot be static/inline general cleanup sql/slave.h: some routines are now extern because they are called from log_event.cc sql/sql_class.cc: added slave_net sql/sql_class.h: added slave_net to THD MYSQL_LOG::write now handles generic Log_event sql/sql_load.cc: changes for new handling of LOAD DATA INFILE replication sql/sql_repl.cc: added log_loaded_block() callback for IO_CACHE sql/sql_repl.h: added structure to pass args to IO_CACHE callback from mysql_load
This commit is contained in:
@ -223,7 +223,7 @@ static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl,
|
||||
opt_ansi_mode=0,opt_myisam_log=0,
|
||||
opt_large_files=sizeof(my_off_t) > 4;
|
||||
bool opt_sql_bin_update = 0, opt_log_slave_updates = 0, opt_safe_show_db=0,
|
||||
opt_show_slave_auth_info = 0;
|
||||
opt_show_slave_auth_info = 0, opt_old_rpl_compat = 0;
|
||||
FILE *bootstrap_file=0;
|
||||
int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
|
||||
extern MASTER_INFO glob_mi;
|
||||
@ -718,6 +718,7 @@ void clean_up(bool print_message)
|
||||
free_defaults(defaults_argv);
|
||||
my_free(charsets_list, MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(mysql_tmpdir,MYF(0));
|
||||
my_free(slave_load_tmpdir,MYF(0));
|
||||
x_free(opt_bin_logname);
|
||||
bitmap_free(&temp_pool);
|
||||
free_max_user_conn();
|
||||
@ -2518,7 +2519,8 @@ enum options {
|
||||
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINK, OPT_REPORT_HOST,
|
||||
OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
|
||||
OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
|
||||
OPT_SHOW_SLAVE_AUTH_INFO};
|
||||
OPT_SHOW_SLAVE_AUTH_INFO, OPT_OLD_RPL_COMPAT,
|
||||
OPT_SLAVE_LOAD_TMPDIR};
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"ansi", no_argument, 0, 'a'},
|
||||
@ -2611,6 +2613,7 @@ static struct option long_options[] = {
|
||||
OPT_SAFEMALLOC_MEM_LIMIT},
|
||||
{"new", no_argument, 0, 'n'},
|
||||
{"old-protocol", no_argument, 0, 'o'},
|
||||
{"old-rpl-compat", no_argument, 0, (int)OPT_OLD_RPL_COMPAT},
|
||||
#ifdef ONE_THREAD
|
||||
{"one-thread", no_argument, 0, (int) OPT_ONE_THREAD},
|
||||
#endif
|
||||
@ -2659,6 +2662,7 @@ static struct option long_options[] = {
|
||||
{"skip-stack-trace", no_argument, 0, (int) OPT_SKIP_STACK_TRACE},
|
||||
{"skip-symlink", no_argument, 0, (int) OPT_SKIP_SYMLINK},
|
||||
{"skip-thread-priority", no_argument, 0, (int) OPT_SKIP_PRIOR},
|
||||
{"slave-load-tmpdir", required_argument, 0, (int) OPT_SLAVE_LOAD_TMPDIR},
|
||||
{"sql-bin-update-same", no_argument, 0, (int) OPT_SQL_BIN_UPDATE_SAME},
|
||||
#include "sslopt-longopts.h"
|
||||
#ifdef __WIN__
|
||||
@ -3311,6 +3315,12 @@ static void get_options(int argc,char **argv)
|
||||
safemalloc_mem_limit = atoi(optarg);
|
||||
#endif
|
||||
break;
|
||||
case OPT_SLAVE_LOAD_TMPDIR:
|
||||
slave_load_tmpdir = my_strdup(optarg, MYF(MY_FAE));
|
||||
break;
|
||||
case OPT_OLD_RPL_COMPAT:
|
||||
opt_old_rpl_compat = 1;
|
||||
break;
|
||||
case OPT_SHOW_SLAVE_AUTH_INFO:
|
||||
opt_show_slave_auth_info = 1;
|
||||
break;
|
||||
@ -4377,6 +4387,14 @@ static void fix_paths(void)
|
||||
mysql_tmpdir=(char*) my_realloc(mysql_tmpdir,(uint) strlen(mysql_tmpdir)+1,
|
||||
MYF(MY_HOLD_ON_ERROR));
|
||||
}
|
||||
if (!slave_load_tmpdir)
|
||||
{
|
||||
int copy_len;
|
||||
slave_load_tmpdir = (char*) my_malloc((copy_len=strlen(mysql_tmpdir) + 1)
|
||||
, MYF(MY_FAE));
|
||||
// no need to check return value, if we fail, my_malloc() never returns
|
||||
memcpy(slave_load_tmpdir, mysql_tmpdir, copy_len);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user