Bug #2905 mysqladmin fails to pick up default port
Submitted: 20 Feb 2004 10:15 Modified: 1 Mar 2004 2:50
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.0/4.1 OS:
Assigned to: Bugs System CPU Architecture:Any

[20 Feb 2004 10:15] Paul DuBois
mysqladmin.c fails to use MYSQL_PORT as the
default value of the TCP/IP port. This means that
if you run configure with a --with-tcp-port option,
mysqladmin ignores the value.

Here is the option structure from mysqladmin.c:

  {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port,
   (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

Compare that with the corresponding option structure
from other clients, such as mysql.cc:

  {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
   (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,

Note the argument following the REQUIRED_ARG in the two cases.

How to repeat:
See above.

The mysqltest.c and thread_test.c files don't use MYSQL_PORT, either.

Suggested fix:
Change the argument following REQUIRED_ARG from
[1 Mar 2004 2:50] Ulrich Bayer
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at