From 275c0eb764e2bb4288f68d6ddc11706df2cde61a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Feb 2004 14:02:32 +0200 Subject: A fix for double free of memory in mysqlbinlog. --- client/mysqlbinlog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/mysqlbinlog.cc') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 71819070a85..1be4b3754d0 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -938,7 +938,7 @@ int main(int argc, char** argv) { if (init_tmpdir(&tmpdir, 0)) exit(1); - dirname_for_local_load= my_tmpdir(&tmpdir); + dirname_for_local_load= my_strdup(my_tmpdir(&tmpdir),MY_WME); } if (load_processor.init()) -- cgit v1.2.1 From c29415cb345e386b18983fcbb36cece7e1f940fb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Mar 2004 17:58:36 +0000 Subject: Fixed Bug#2491, INSERT DELAYED causes binary log unusable by mysqlbinlog (replication is ok) Setting insert delayed threads = 0 at mysql_init_command. sql/mysql_priv.h: New session variable, max_insert_delayed_threads sql/mysqld.cc: New session variable, max_insert_delayed_threads sql/set_var.cc: New session variable, max_insert_delayed_threads sql/sql_class.h: New session variable, max_insert_delayed_threads sql/sql_insert.cc: New session variable, max_insert_delayed_threads BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- client/mysqlbinlog.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'client/mysqlbinlog.cc') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 1be4b3754d0..9d9a414ad02 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -480,7 +480,7 @@ static void die(const char* fmt, ...) static void print_version() { - printf("%s Ver 2.5 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + printf("%s Ver 2.6 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); } @@ -562,9 +562,12 @@ static int parse_args(int *argc, char*** argv) static MYSQL* safe_connect() { MYSQL *local_mysql = mysql_init(NULL); + if(!local_mysql) die("Failed on mysql_init"); - + + mysql_options(local_mysql, MYSQL_INIT_COMMAND, + "/*!32210 SET @@session.max_insert_delayed_threads=0*/"); if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) die("failed on connect: %s", mysql_error(local_mysql)); -- cgit v1.2.1 From e6270d31f2189aef05eb40845cda8d33969c7d37 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Mar 2004 15:41:07 +0200 Subject: Small fixes. client/mysqlbinlog.cc: Patched patch for Bug#2491. sql/set_var.cc: Added max_insert_delayed_threads into 'SHOW VARIABLES'. --- client/mysqlbinlog.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client/mysqlbinlog.cc') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 9d9a414ad02..72f68f9fe86 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -306,6 +306,7 @@ int process_event(ulonglong *rec_count, char *last_db, Log_event *ev, my_off_t pos, int old_format) { char ll_buff[21]; + if ((*rec_count) >= offset) { if (!short_form) @@ -566,8 +567,6 @@ static MYSQL* safe_connect() if(!local_mysql) die("Failed on mysql_init"); - mysql_options(local_mysql, MYSQL_INIT_COMMAND, - "/*!32210 SET @@session.max_insert_delayed_threads=0*/"); if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) die("failed on connect: %s", mysql_error(local_mysql)); @@ -952,6 +951,8 @@ int main(int argc, char** argv) load_processor.init_by_cur_dir(); exit_value= 0; + fprintf(result_file, + "/*!40001 SET @@session.max_insert_delayed_threads=0*/;\n"); while (--argc >= 0) { if (dump_log_entries(*(argv++))) -- cgit v1.2.1 From f9be00959b6b87d883d2e145f74700f099df9ba4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Mar 2004 20:12:16 +0200 Subject: Fixed error in version. --- client/mysqlbinlog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/mysqlbinlog.cc') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 72f68f9fe86..29ee6efbfb0 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -952,7 +952,7 @@ int main(int argc, char** argv) exit_value= 0; fprintf(result_file, - "/*!40001 SET @@session.max_insert_delayed_threads=0*/;\n"); + "/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n"); while (--argc >= 0) { if (dump_log_entries(*(argv++))) -- cgit v1.2.1 From e05fc023db16e8b6a955311c0e09b08c53223796 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Mar 2004 22:01:29 +0100 Subject: Force mysqlbinlog to require an argument if --local-load is used (--local-load alone means "I want files to be prepared for LOAD DATA INFILE, in the default temp directory", and mysqlbinlog already does this without --local-load). client/mysqlbinlog.cc: --local-load always needs an argument; --local-load alone is of no use. --- client/mysqlbinlog.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/mysqlbinlog.cc') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 72f68f9fe86..58adbdf9042 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -438,9 +438,9 @@ static struct my_option my_long_options[] = {"user", 'u', "Connect to the remote server as username.", (gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"local-load", 'l', "Prepare files for local load in directory.", + {"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.", (gptr*) &dirname_for_local_load, (gptr*) &dirname_for_local_load, 0, - GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, + GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} @@ -947,7 +947,7 @@ int main(int argc, char** argv) exit(1); if (dirname_for_local_load) load_processor.init_by_dir_name(dirname_for_local_load); - else + else /* my_malloc() failed in my_strdup() */ load_processor.init_by_cur_dir(); exit_value= 0; -- cgit v1.2.1