summaryrefslogtreecommitdiff
path: root/netware
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com/sin.intern.azundris.com>2007-09-13 16:19:46 +0200
committerunknown <tnurnberg@mysql.com/sin.intern.azundris.com>2007-09-13 16:19:46 +0200
commitee7f125d5f42fd653cb09cf5b15ae9384b7d9248 (patch)
tree602e3e9d9862d8866b20f7d497d64c91d470ea4e /netware
parent28ec0efcb6810c98af5bfbeeaaf0bfa13343a874 (diff)
downloadmariadb-git-ee7f125d5f42fd653cb09cf5b15ae9384b7d9248.tar.gz
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
Diffstat (limited to 'netware')
-rw-r--r--netware/mysql_test_run.c3
-rw-r--r--netware/mysqld_safe.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
index 6bab2f0149c..a62de9013f9 100644
--- a/netware/mysql_test_run.c
+++ b/netware/mysql_test_run.c
@@ -1170,7 +1170,8 @@ void setup(char *file)
setenv("MYSQL_BINLOG", file_path, 1);
setenv("MASTER_MYPORT", "9306", 1);
setenv("SLAVE_MYPORT", "9307", 1);
- setenv("MYSQL_TCP_PORT", "3306", 1);
+ snprintf(file_path, PATH_MAX*2, "%d", MYSQL_PORT);
+ setenv("MYSQL_TCP_PORT", file_path, 1);
snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port);
setenv("MYSQL_CLIENT_TEST",file_path,1);
snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port);
diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c
index 9db8a441ca3..00e7d1bcd51 100644
--- a/netware/mysqld_safe.c
+++ b/netware/mysqld_safe.c
@@ -189,7 +189,7 @@ void start_defaults(int argc, char *argv[])
snprintf(address, PATH_MAX, "0.0.0.0");
// port
- snprintf(port, PATH_MAX, "3306");
+ snprintf(port, PATH_MAX, "%d", MYSQL_PORT);
// default option
default_option[0]= NULL;