Bug #604 mysqlimport
Submitted: 6 Jun 2003 5:14 Modified: 3 Jul 2003 8:02
Reporter: Alexandr Staroverov Email Updates:
Status: Won't fix Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.0.13 OS:Linux (RedHat Linux)
Assigned to: Jani Tolonen CPU Architecture:Any

[6 Jun 2003 5:14] Alexandr Staroverov
mysqlimport failed when in ~/.my.cnf specified database name

How to repeat:

$ mysqlimport mydb myfile.txt

Suggested fix:
>   {"database", 'D', "Database to use.", (gptr*) &current_db,
>    (gptr*) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
[3 Jul 2003 5:48] Michael Widenius
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

This is not a bug as all mysqlclients doesn't take database as an argument.

What needs to be done is to document exactly what options are allowed in the [client] section.  I will ask our documentation team to do this ASAP.
[3 Jul 2003 7:20] Alexandr Staroverov
Sorry, I made a mistake, when recommended to fix bug in mysqlimport.c
Problem is not here.
Parameter 'database' from section 'Client' of my.cnf is very useful for utility 'mysql' and many others, but not supported by utility 'mysqlimport'.
'mysqlimport' SHOULD ignore this parameter, but it doesn't.
Problem is in function handle_options (mysys/my_getopt.c).
I agree that if user gives wrong parameter in command line, then utility should print error message and exit, but if unsupported parameter found in configuration file, then it SHOULD BE IGNORED.
[3 Jul 2003 8:02] Sergei Golubchik
I, personally, don't agree that any unknown option SHOULD BE IGNORED.

But, anyway, this is documentation issue. An option can be prepended with loose-
and my_getopt (mysqld and clients) won't treat this option as error if it's unknown.
Originally it was designed to simplify running MySQL of different versions on the same my.cnf file.

So, all you have to do, is to write in my.cnf
[3 Jul 2003 8:49] Alexandr Staroverov
Funny to add parameter loose-database to my.cnf, but it works.
Thanks a lot.