Bug #3041 --safe-updates option declaration anomaly
Description:
I'll just repeat the relevant email here:
Date: Tue, 2 Mar 2004 18:10:55 +0100
From: Sergei Golubchik <serg@mysql.com>
To: Paul DuBois <paul@mysql.com>
Cc: dev-public@mysql.com
Subject: Re: --safe-updates oddity?
Hi!
On Feb 29, Paul DuBois wrote:
> I noticed today that --safe-updates/--i-am-a-dummy option for
> mysql is listed in the manual as taking an optional argument:
>
> @item --safe-updates[=#], --i-am-a-dummy[=#], -U[#]
> Only allow @code{UPDATE} and @code{DELETE} that uses keys. See below for
> more information about this option. You can reset this option if you have
> it in your @file{my.cnf} file by using @code{--safe-updates=0}.
>
> I never knew it took an argument, so I figured I'd look in the source
> to see what meaning the value might have. Indeed the option structures
> in mysql.cc allow an optional argument:
>
> {"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
> (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, OPT_ARG, 0, 0,
> 0, 0, 0, 0},
> {"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
> (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, OPT_ARG, 0, 0,
> 0, 0, 0, 0},
>
> However, the variable itself is a my_bool type, and the value is only
> tested in if() conditionals, but never otherwise used.
>
> So it appears to me that the manual should just remove the [=#] from
> the description, and OPT_ARG in mysql.cc should be changed to NO_ARG.
>
> Is that correct?
Yes, I think so.
Regards,
Sergei
How to repeat:
See above.
Suggested fix:
See above for change to mysql.cc.
I'll change the documentation.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: I'll just repeat the relevant email here: Date: Tue, 2 Mar 2004 18:10:55 +0100 From: Sergei Golubchik <serg@mysql.com> To: Paul DuBois <paul@mysql.com> Cc: dev-public@mysql.com Subject: Re: --safe-updates oddity? Hi! On Feb 29, Paul DuBois wrote: > I noticed today that --safe-updates/--i-am-a-dummy option for > mysql is listed in the manual as taking an optional argument: > > @item --safe-updates[=#], --i-am-a-dummy[=#], -U[#] > Only allow @code{UPDATE} and @code{DELETE} that uses keys. See below for > more information about this option. You can reset this option if you have > it in your @file{my.cnf} file by using @code{--safe-updates=0}. > > I never knew it took an argument, so I figured I'd look in the source > to see what meaning the value might have. Indeed the option structures > in mysql.cc allow an optional argument: > > {"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.", > (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, OPT_ARG, 0, 0, > 0, 0, 0, 0}, > {"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.", > (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, OPT_ARG, 0, 0, > 0, 0, 0, 0}, > > However, the variable itself is a my_bool type, and the value is only > tested in if() conditionals, but never otherwise used. > > So it appears to me that the manual should just remove the [=#] from > the description, and OPT_ARG in mysql.cc should be changed to NO_ARG. > > Is that correct? Yes, I think so. Regards, Sergei How to repeat: See above. Suggested fix: See above for change to mysql.cc. I'll change the documentation.