Bug #3162 mysqlbinlog doesn't require value for --local-load option
Submitted: 12 Mar 2004 15:10 Modified: 13 Mar 2004 7:13
Reporter: Paul Dubois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.0 OS:
Assigned to: Guilhem Bichot CPU Architecture:Any

[12 Mar 2004 15:10] Paul Dubois
Description:
The problem is summarized in the mail message below.
(This is a private message, but the thread originated on
dev-public@ with the same topic.)

Subject: Re: mysqlbinlog questions
From: Guilhem Bichot <guilhem@mysql.com>
To: Paul DuBois <paul@mysql.com>
Date: Fri, 12 Mar 2004 22:02:36 +0100

On Fri, 2004-03-12 at 21:07, Paul DuBois wrote:
> >Hi,
> >
> >On Fri, 2004-03-12 at 20:34, Paul DuBois wrote:
> >>  At 20:13 +0300 3/12/04, Dmitri Lenev wrote:
> >>  >Hi, Paul!
> >>  >
> >>  >* Paul DuBois <paul@mysql.com> [04/03/12 02:55]:
> >
> >>
> >>  >  > The option is documented like this:
> >>  >>
> >>  >>  @item --local-load[=path], -l[path]
> >>  >>  Prepare files for local load in the given directory.
> >>  >>
> >>  >>  What is the point of allowing the path value to be optional? 
> >>I cannot see
> >>  >>  that specifying --local-load without a path value has any 
> >>effect different
> >>  >>  than not specifying the option at all. That is, it appears to do nothing
> >>  >>  without a path value.  Am I missing something?
> >>  >
> >>  >No, you are right. --local-load only specifies directory for temporary
> >>  >files which are produced during dumping of LOAD DATA statements...
> >>
> >>  Yes, that I understood.  What I'm unclear about is why the option value
> >>  (the path) should be optional rather than mandatory.
> >
> >local-load should require a mandatory argument, as you suggest;
> >presently, using the option without an argument is like not using the
> >option. I will take care of fixing code next week.
> 
> Thanks.  Should I file a bug report so there is a record of it?

yes, thank you. I am pushing a fix into 4.0 now.

How to repeat:
There's nothing to repeat. The problem is obvious
by inspection. :-)

Suggested fix:
I suppose in mysqlbinlog.cc, change this:

  {"local-load", 'l', "Prepare files for local load in directory.",
   (gptr*) &dirname_for_local_load, (gptr*) &dirname_for_local_load, 0,
   GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0},

To this:

  {"local-load", 'l', "Prepare files for local load in directory.",
   (gptr*) &dirname_for_local_load, (gptr*) &dirname_for_local_load, 0,
   GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

(OPT_ARG -> REQUIRED_ARG)
[13 Mar 2004 7:13] Guilhem Bichot
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
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fixed in ChangeSet@1.1743.3.1, 2004-03-12 22:01:29+01:00, guilhem@mysql.com
--local-load now requires an argument (the option without argument did nothing).