List:General Discussion« Previous MessageNext Message »
From:Eric Bergen Date:November 24 2012 4:53pm
Subject:Re: Why configuration directives are all case sensitive?
View as plain text  
Yes, the missing piece of the puzzle is that configuration files are
turned into command line arguments internally. Programs will parse
configuration files and place them at the beginning of the array for
command line arguments. They are made case sensitive because they are
turned into command line arguments. So the basic process is read all
the configuration files in order of precedence into the beginning of
the command line array. Then send this array to the command line
handling code. This is also how argument precedence works. As the
array is walked through options will override previous options so
things passed on the command line are at the end and override options
in the config file.

On Fri, Nov 23, 2012 at 10:08 PM, Tianyin Xu <tixu@stripped> wrote:
> Dear Eric,
>
> Thanks a lot for the explanation of argument directives! The concerns are
> very considerate.
>
> Actually, what I'm curious about is the configuration directives in the
> configuration file, i.e., my.cnf. To my experience, MySQL is the very few
> software who treats these directives in a case sensitive manner.
>
> The directives in the configuration file is different from the arguments,
> because we don't have something like --port and -P. So, a directive like
> "Port" clearly indicates that the user specifies "port" (exactly as you
> said). And this's the reason that most apps do not differentiate them.
>
> Could you please explain about the directives in the configuration file?
>
> Thanks a lot!
>
> Happy Thanksgiving!!
> Tianyin
>
>
>
> On Fri, Nov 23, 2012 at 4:20 PM, Eric Bergen <eric.bergen@stripped> wrote:
>>
>> Anger and OS religious arguments the real answer is that is just how
>> the option parsing code works. It doesn't always have to make sense.
>> There are short and long args to programs. For example on the mysql
>> client there is --port or -P and --pasword or -p. The short options
>> have to be case sensitive because -P and -p mean different things. The
>> short options are case sensitive so the long options may as well be.
>> It keeps things simpler. Who wants to write --Port when --port means
>> not hitting the shift key?
>>
>> There are a few exceptions to this. The option comparison treats _ and
>> - as the same. I realize that isn't case but it just shows the
>> matching isn't exact. So --show_warnings is valid. On the other side
>> of the equal sign comparisons for true, on, false, and off are done
>> case insensitive. So --show_warnings=FaLse is valid but
>> --show_warningS=TruE isn't.
>>
>> If you want to be even more confused consider that mysql allows
>> partial argument names. You don't have to type out the full long arg
>> as long as you type enough that it only matches one option. For
>> example mysql --so is enough to mean socket but mysql --s isn't
>> because it can't be distinguished from 'show' variables. This gets
>> confusing with things like b. mysql --b is batch mode. So is mysql -B
>> but mysql -b is no beep. Confused yet?
>>
>> On Sun, Nov 18, 2012 at 6:42 PM, Tianyin Xu <tixu@stripped> wrote:
>> > On Sun, Nov 18, 2012 at 6:13 PM, Reindl Harald
>> > <h.reindl@stripped>wrote:
>> >
>> >>
>> >>
>> >> Am 19.11.2012 02:07, schrieb Tianyin Xu:
>> >> > You are saying as long as admins are careful, there's no
>> >> misconfiguration?
>> >> > But why misconfigurations are so pervasive?
>> >> > Simply because the admins are not careful enough?
>> >>
>> >> yes
>> >>
>> >>
>> > That means not only I'm dummy, and that's means you should take care the
>> > system configuration design if many people are careless.
>> >
>> >
>> >
>> >> > I apologize for my lack of respect. I don't know what's your
> stuff,
>> >> > but
>> >> > I guess they'll be more popular if you make them more friendly.
>> >>
>> >> it does not need to be more popular
>> >> it is better not to be too popular but working clean and safe
>> >>
>> >> careless working these days means usually also not care
>> >> about security which is not acceptable htese days and i
>> >> know a lot of crap out there which is more popluar like
>> >> my work but with crappy quality and terrible insecure
>> >>
>> >> see all this CMS sytems out there writing hundrets of
>> >> warnings each request with error_reporting E_STRICT
>> >> while my whole source code runs clean i know who is right
>> >>
>> >> really:
>> >> if you find it useful to complain why a configuration is
>> >> case-sensitive instead accept it and correct your fault
>> >> you are doing the wrong job
>> >>
>> >>
>> > I'm complaining nothing. I just curious about the configuration and want
>> > to
>> > know you developers' thinking. I apologize if I gave you the impression
>> > of
>> > complaining by asking questions.
>> >
>> > Basically, I'm new to MySQL and find MySQL really take care about lots
>> > of
>> > things to give users an easy job. For example, the unit, the enumeration
>> > options, all are case insensitive -- "512K" and "512k" means the same
>> > size,
>> > "MIXED" and "mixed" means the same option, etc. Having such impression,
>> > when MySQL tells me 'Port' is unknown, it did take me some time to
>> > figure
>> > it out. Maybe simply because all the other servers I used like
>> > PostgreSQL,
>> > httpd, etc are case insensitive. That's the whole story, and that's why
>> > I
>> > ask on the forum, being curious about the reason.
>> >
>> > It's fine that you told me it's simply because you developers assume
>> > nobody
>> > "came to the idea write options
>> > not EXACTLY like they are in the documentation", so you simply do not
>> > want
>> > to do it. But I do not buy this, because MySQL developers do take care a
>> > lot of things (as unit and options I mentioned).
>> >
>> > T
>> >
>> >
>> > --
>> > Tianyin XU,
>> > http://cseweb.ucsd.edu/~tixu/
>>
>>
>>
>> --
>> Eric Bergen
>> eric.bergen@stripped
>> http://www.ebergen.net
>
>
>
>
> --
> Tianyin XU,
> http://cseweb.ucsd.edu/~tixu/



-- 
Eric Bergen
eric.bergen@stripped
http://www.ebergen.net
Thread
Why configuration directives are all case sensitive?Tianyin Xu18 Nov
  • Re: Why configuration directives are all case sensitive?Reindl Harald18 Nov
    • Re: Why configuration directives are all case sensitive?Tianyin Xu19 Nov
      • Re: Why configuration directives are all case sensitive?Reindl Harald19 Nov
        • Re: Why configuration directives are all case sensitive?Tianyin Xu19 Nov
          • Re: Why configuration directives are all case sensitive?Reindl Harald19 Nov
            • Re: Why configuration directives are all case sensitive?Karen Abgarian19 Nov
            • Re: Why configuration directives are all case sensitive?Tianyin Xu19 Nov
              • Re: Why configuration directives are all case sensitive?Eric Bergen24 Nov
                • Re: Why configuration directives are all case sensitive?Tianyin Xu24 Nov
                  • Re: Why configuration directives are all case sensitive?Eric Bergen24 Nov
                    • Re: Why configuration directives are all case sensitive?Tianyin Xu24 Nov
                • Re: Why configuration directives are all case sensitive?Johan De Meersman26 Nov