From ee7f125d5f42fd653cb09cf5b15ae9384b7d9248 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Sep 2007 16:19:46 +0200 Subject: Bug #15327: configure: --with-tcp-port option being partially ignored make sure that if builder configured with a non-standard (!= 3306) default TCP port that value actually gets used throughout. if they didn't configure a value, assume "use a sensible default", which will be read from /etc/services or, failing that, from the factory default. That makes the order of preference - command-line option - my.cnf, where applicable - $MYSQL_TCP_PORT environment variable - /etc/services (unless configured --with-tcp-port) - default port (--with-tcp-port=... or factory default) client/mysql.cc: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysql_upgrade.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysqladmin.cc: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysqlbinlog.cc: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysqlcheck.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysqldump.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysqlimport.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysqlmanagerc.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear configure.in: Bug #15327: configure: --with-tcp-port option being partially ignored If MYSQL_TCP_PORT defaulted in configure (factory default 3306 at the time of this writing), set MYSQL_TCP_PORT to factory default, then clear factory default after. That way, we lose no information, and we can distinguish between "defaulted" and the pathological case "builder specifically configured a port that coincides with factory default." This can in theory happen if builder configures and builds several servers from a script (--with-tcp-port=3306, --with-tcp-port=3316, --with-tcp-port=3326). Not all that probable, but much preferable to having more "magic" happen in the server when we can solve this without any guesswork. client/mysqlshow.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear client/mysqltest.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear include/mysql_version.h.in: Bug #15327: configure: --with-tcp-port option being partially ignored make factory default for TCP port available as MYSQL_PORT_DEFAULT if build-time configured with a different default. (0 if unchanged) libmysql/libmysql.c: Bug #15327: configure: --with-tcp-port option being partially ignored initialize default tcp port for client, like so: - if user configured --with-tcp-port, use that value as default - otherwise assume "use a good default": search mysqld/tcp in /etc/services; if that doesn't exist, use factory default (3306) - environment variable MYSQL_TCP_PORT overrides this default - command-line option overrides all of the above mysql-test/Makefile.am: Bug #15327: configure: --with-tcp-port option being partially ignored make factory default for TCP port available as MYSQL_TCP_PORT_DEFAULT if build-time configured with a different default. (0 if unchanged) mysql-test/mysql-test-run-shell.sh: Bug #15327: configure: --with-tcp-port option being partially ignored set up MYSQL_TCP_PORT if not already set in environment: - if user configured --with-tcp-port, use that value as default - otherwise assume "use a good default": search mysqld/tcp in /etc/services; if that doesn't exist, use factory default (3306) netware/mysql_test_run.c: Bug #15327: configure: --with-tcp-port option being partially ignored account for non-standard default port-no. configured at build-time netware/mysqld_safe.c: Bug #15327: configure: --with-tcp-port option being partially ignored account for non-standard default port-no. configured at build-time scripts/Makefile.am: Bug #15327: configure: --with-tcp-port option being partially ignored make factory default for TCP port available as MYSQL_TCP_PORT_DEFAULT if build-time configured with a different default. (0 if unchanged) scripts/mysql_config.sh: Bug #15327: configure: --with-tcp-port option being partially ignored set up MYSQL_TCP_PORT if not already set in environment: - if user configured --with-tcp-port, use that value as default - otherwise assume "use a good default": search mysqld/tcp in /etc/services; if that doesn't exist, use factory default (3306) scripts/mysql_fix_privilege_tables.sh: Bug #15327: configure: --with-tcp-port option being partially ignored clarifying notice only scripts/mysqld_safe-watch.sh: Bug #15327: configure: --with-tcp-port option being partially ignored account for non-standard default port-no. configured at build-time server-tools/instance-manager/priv.h: Bug #15327: configure: --with-tcp-port option being partially ignored account for non-standard default port-no. configured at build-time sql/mysqld.cc: Bug #15327: configure: --with-tcp-port option being partially ignored if builder specifically requested a default port, use that (even if it coincides with our factory default). only if they didn't do we check /etc/services (and, failing on that, fall back to the factory default of 3306). either default can be overridden by the environment variable MYSQL_TCP_PORT, which in turn can be overridden with command line options. tests/mysql_client_test.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear tests/ssl_test.c: Bug #15327: configure: --with-tcp-port option being partially ignored account for non-standard default port-no. configured at build-time tests/thread_test.c: Bug #15327: configure: --with-tcp-port option being partially ignored make help on --port a little more clear --- client/mysql.cc | 11 ++++++++--- client/mysql_upgrade.c | 9 +++++++-- client/mysqladmin.cc | 8 +++++++- client/mysqlbinlog.cc | 11 ++++++++--- client/mysqlcheck.c | 8 +++++++- client/mysqldump.c | 8 +++++++- client/mysqlimport.c | 8 +++++++- client/mysqlmanagerc.c | 7 ++++++- client/mysqlshow.c | 8 +++++++- client/mysqltest.c | 8 +++++++- 10 files changed, 71 insertions(+), 15 deletions(-) (limited to 'client') diff --git a/client/mysql.cc b/client/mysql.cc index 368fce30d67..4f045e21cbd 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -673,9 +673,14 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, - (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, - 0}, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, + (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"prompt", OPT_PROMPT, "Set the mysql prompt to this value.", (gptr*) ¤t_prompt, (gptr*) ¤t_prompt, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 64de3d19882..f2bd4a3fa35 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -88,8 +88,13 @@ static struct my_option my_long_options[]= {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", 0, - 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index c7033f6914f..54f67c5df2d 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -159,7 +159,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &tcp_port, (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index a371981e24d..3d06a21c243 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -687,9 +687,14 @@ static struct my_option my_long_options[] = 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to connect to remote server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Use port to connect to the remote server.", - (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, - 0, 0, 0}, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, {"position", 'j', "Deprecated. Use --start-position instead.", (gptr*) &start_position, (gptr*) &start_position, 0, GET_ULL, REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE, diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index b69e9201a28..8205a83fdf4 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -123,7 +123,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", diff --git a/client/mysqldump.c b/client/mysqldump.c index 1a024a923f5..1a809ca8b6c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -361,7 +361,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", diff --git a/client/mysqlimport.c b/client/mysqlimport.c index e7bf1cfd889..066e892f78a 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -119,7 +119,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", diff --git a/client/mysqlmanagerc.c b/client/mysqlmanagerc.c index 1fdedab97fb..b4cc6320047 100644 --- a/client/mysqlmanagerc.c +++ b/client/mysqlmanagerc.c @@ -49,7 +49,12 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection.", (gptr*) &port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", (gptr*) &port, (gptr*) &port, 0, GET_UINT, REQUIRED_ARG, MYSQL_MANAGER_PORT, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 5be01cc5a52..7b1835055f5 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -188,7 +188,13 @@ static struct my_option my_long_options[] = {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __WIN__ diff --git a/client/mysqltest.c b/client/mysqltest.c index d1ec753b54b..ff45f80d914 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4512,7 +4512,13 @@ static struct my_option my_long_options[] = GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_port, (gptr*) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication", (gptr*) &ps_protocol, (gptr*) &ps_protocol, 0, -- cgit v1.2.1 From 3bc5123e824e0b4c696dacac5847606ea208f053 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Sep 2007 04:59:46 +0200 Subject: Bug #15327: configure: --with-tcp-port option being partially ignored after merge fix :-/ --- client/mysqlbinlog.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'client') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index f848a98e5a6..2110f27d887 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -762,7 +762,6 @@ static struct my_option my_long_options[] = "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", (uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - 0, 0, 0}, {"position", 'j', "Deprecated. Use --start-position instead.", (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL, REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE, -- cgit v1.2.1 From 3f4eaf57e9907011ef97de1cec4f512ce59aabb3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Oct 2007 08:27:03 +0200 Subject: Bug #30444: 5.0 mysqldump silently allows wrong backup to be taken against a 4.0 database The combination of --single-transaction and --master-data requires START TRANSACTION WITH CONSISTENT SNAPSHOT which is available from mysqld 4.1 on. When trying this against an older server, print diagnostic, then, if --force is not given, abort. No test-case given since it would require a mysqld < 4.1. client/mysqldump.c: Bug #30444: 5.0 mysqldump silently allows wrong backup to be taken against a 4.0 database The combination of --single-transaction and --master-data requires START TRANSACTION WITH CONSISTENT SNAPSHOT which is available from mysqld 4.1 on. When trying this against an older server, print diagnostic, then, if --force is not given, abort. --- client/mysqldump.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'client') diff --git a/client/mysqldump.c b/client/mysqldump.c index 3bf9fff1b86..a2a03334ba3 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2428,6 +2428,18 @@ static int start_transaction(MYSQL *mysql_con) need the REPEATABLE READ level (not anything lower, for example READ COMMITTED would give one new consistent read per dumped table). */ + if ((mysql_get_server_version(mysql_con) < 40100) && opt_master_data) + { + fprintf(stderr, "-- %s: the combination of --single-transaction and " + "--master-data requires a MySQL server version of at least 4.1 " + "(current server's version is %s). %s\n", + ignore_errors ? "Warning" : "Error", + mysql_con->server_version ? mysql_con->server_version : "unknown", + ignore_errors ? "Continuing due to --force, backup may not be consistent across all tables!" : "Aborting."); + if (!ignore_errors) + exit(EX_MYSQLERR); + } + return (mysql_query_with_error_report(mysql_con, 0, "SET SESSION TRANSACTION ISOLATION " "LEVEL REPEATABLE READ") || -- cgit v1.2.1 From b07a4abc4fefb2e14cdcd3203b92865a643bf962 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Oct 2007 18:18:50 +0200 Subject: Bug#31398 problems with mysql-test-run, part2 Write .reject file to r/ if it's writable else use opt_logdir client/mysqltest.c: Write .reject file to r/ if it's writable else use opt_logdir --- client/mysqltest.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'client') diff --git a/client/mysqltest.c b/client/mysqltest.c index a2412d4b30e..eae3b05f61a 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1580,10 +1580,21 @@ void check_result(DYNAMIC_STRING* ds) and then show the diff */ char reject_file[FN_REFLEN]; - str_to_file(fn_format(reject_file, result_file_name, opt_logdir, ".reject", - *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : - MY_REPLACE_EXT), - ds->str, ds->length); + dirname_part(reject_file, result_file_name); + + if (access(reject_file, W_OK) == 0) + { + /* Result file directory is writable, save reject file there */ + fn_format(reject_file, result_file_name, NULL, + ".reject", MY_REPLACE_EXT); + } + else + { + /* Put reject file in opt_logdir */ + fn_format(reject_file, result_file_name, opt_logdir, + ".reject", MY_REPLACE_DIR | MY_REPLACE_EXT); + } + str_to_file(reject_file, ds->str, ds->length); dynstr_set(ds, NULL); /* Don't create a .log file */ -- cgit v1.2.1 From cb16dedb8505ff376a5803510fa64702881f90fa Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Oct 2007 18:22:28 +0200 Subject: Update for 5.1 format of dirname_part --- client/mysqltest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/mysqltest.c b/client/mysqltest.c index 4a80ad8d715..335a1590e1b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1562,8 +1562,8 @@ void check_result(DYNAMIC_STRING* ds) Result mismatched, dump results to .reject file and then show the diff */ - char reject_file[FN_REFLEN]; - dirname_part(reject_file, result_file_name); + char reject_file[FN_REFLEN], reject_length; + dirname_part(reject_file, result_file_name, &reject_length); if (access(reject_file, W_OK) == 0) { -- cgit v1.2.1 From 8dd586916c3c4e00f277f2d01b20704ae1080697 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 17:43:32 -0400 Subject: Bug#28535 mistake in mysqldump error message - Fixed error message. client/mysqldump.c: Bug#28535 mistake in mysqldump error message - Corrected parameter order. --- client/mysqldump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/mysqldump.c b/client/mysqldump.c index 582e9e3b3b9..b6efe89be22 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1888,7 +1888,7 @@ static uint dump_events_for_db(char *db) if (create_delimiter(row[3], delimiter, sizeof(delimiter)) == NULL) { fprintf(stderr, "%s: Warning: Can't create delimiter for event '%s'\n", - event_name, my_progname); + my_progname, event_name); DBUG_RETURN(1); } -- cgit v1.2.1 From d020488971c0f4417f5c7b9a6688f9dfdf6fec98 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 22:30:41 -0400 Subject: Bug#28774 mysql_upgrade creates tempfiles in root-dir (C:\) and doesn't clean them up - Make sure to cleanup temporary files after use. client/mysql_upgrade.c: Bug#28774 mysql_upgrade creates tempfiles in root-dir (C:\) and doesn't clean them up - Close file handle and delete temporary file when write fails. --- client/mysql_upgrade.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'client') diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 1646f2baf51..02829cd2178 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -456,7 +456,11 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, if (my_write(fd, query, strlen(query), MYF(MY_FNABP | MY_WME))) + { + my_close(fd, MYF(0)); + my_delete(query_file_path, MYF(0)); die("Failed to write to '%s'", query_file_path); + } ret= run_tool(mysql_path, ds_res, -- cgit v1.2.1 From ec7baf6eb12f558e908ad50e1948de3a491084c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2007 18:45:29 -0600 Subject: Fix compiler warning (use correct data type) client/mysqltest.c: Use correct data type for dummy variable passed to dirname_part() --- client/mysqltest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/mysqltest.c b/client/mysqltest.c index 335a1590e1b..39fe05e4928 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1562,7 +1562,8 @@ void check_result(DYNAMIC_STRING* ds) Result mismatched, dump results to .reject file and then show the diff */ - char reject_file[FN_REFLEN], reject_length; + char reject_file[FN_REFLEN]; + size_t reject_length; dirname_part(reject_file, result_file_name, &reject_length); if (access(reject_file, W_OK) == 0) -- cgit v1.2.1