From: Masood Mortazavi Date: April 17 2009 3:03am Subject: Re: your patch for BUG#40368 "mysqld_safe to honour underscore same as dash on server options " List-Archive: http://lists.mysql.com/internals/36554 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Guilhem and Arjen - On Thu, Apr 9, 2009 at 3:31 AM, Arjen Lentz wrote: > Hi Guilhem > > On 02/04/2009, at 10:57 PM, Guilhem Bichot wrote: >> >> I'm looking at your patch; agree with the bug's description and idea of >> the patch. >> Good that you insisted on it, we can be slow sometimes :) > > I'm happy that you picked it up. > > >> The patch is: >> >> --- mysql-5.0.67.orig/scripts/mysqld_safe.sh =A0 =A02008-08-04 >> 13:20:02.000000000 +0100 >> +++ mysql-5.0.67/scripts/mysqld_safe.sh 2008-10-28 22:11:06.000000000 >> +0000 >> @@ -59,6 +59,14 @@ >> =A0fi >> >> =A0for arg do >> + >> + =A0 =A0# Replaces all underscores with dashes (excluding the two initi= al >> ones >> + =A0 =A0# and any instances after the first =3D character) since mysqld= accepts >> + =A0 =A0# variables in this format. >> + =A0 =A0substr_a=3D`echo $arg | sed -e 's/\(...\)\(.*\)=3D\(.*\)/\2/'` >> >> Here, you eliminate the 3 first characters ("..."). So if arg is >> --open_files_limit=3D32, substr_a is "pen_files_limit". In the end it wo= rks, >> but why not eliminate only two (two dots)? Why use ".." and not "--" (Wh= at >> else can there be aprt from "--", in this position?). >> >> For the unlikely case where the user would do (gasp): >> --datadir=3D/some/path/with_=3D_in/it , >> we wouldn't want to change "_" to "-" in the path. One would have to be >> crazy, but I prefer to avoid introducing a rare bug when fixing another. >> I propose two precautions to avoid that: >> - forcing the regex to match at start of string, only >> - forcing it to not be greedy by picking the first "=3D"(see below): >> >> + =A0 =A0substr_b=3D`echo $substr_a | sed s/_/-/g` >> + =A0 =A0arg=3D`echo $arg | sed s/$substr_a/$substr_b/g` >> >> With the --datadir option value above, the substituation here fails >> because the sed command line expands to: >> sed s/atadir=3D/some/path/with_/atadir=3D/some/path/with-/g >> (at least with "bash" on my Linux laptop). >> I am thinking about this: >> substr_a=3D`echo $arg | sed -e 's/^\(..\)\([^=3D]*\)=3D\(.*\)/\2/'` >> though I haven't tested on . >> >> Any ideas? > > Sounds sensible. > > >> You mentioned fixing my_print_defaults, why is it needed? > > It was another approach to resolving the same issue, if I remember > correctly. > > >> By the way - paperwork. You have already signed the CLA in 2007; you wil= l >> be happy to know that there is more to do (somehow contribution agreemen= ts >> have been revised since you signed): >> http://forge.mysql.com/wiki/Contributing_Code#Paperwork > > Well, two things: > =A0- Erik Ljungstrom did the patch, not I (he's cc'd on this email). > =A0- This is a few lines of script/code, I think you are quite fine just = using > it. Particularly since you just rewrote it! From past experience at MySQL= , > we never insisted on the CLA for very small patches. > > > Regards, > Arjen. Erik has just signed the SCA. ... and his name is already posted on the SCA signatories list: https://sca.dev.java.net/CA_signatories.htm ... That takes care of the paper work ... - m.