On Mon, 26 Nov 2001, Marjolein Katsma wrote:

> Paul,
> 
> At 16:56 2001-11-25 -0600, Paul DuBois wrote:
> >database,sql,query,table
> >
> >At 7:40 PM +0100 11/25/01, Marjolein Katsma wrote:
> >>At 12:19 2001-11-25 -0600, Paul DuBois wrote:
> >>>>select * from users where dbname= "Brain" returns both "brain" and "Brain".

6.2.3.1 says "Values in CHAR and VARCHAR columns are sorted and compared
in case-insensitive fashion, unless the BINARY attribute was specified
when the table was created.", so this is as expected.

> >>>>I read section 6.3.2.2 and select binary dbname from users where
> >>>>dbname="brain" also returns both records.

Section 6.3.2.2 is perhaps not as clear as it should be.  In any case, to
get a case-sensitive comparison, you have to use BINARY to recast the
string *in the comparison* (i.e the WHERE clause).  Hence, as Paul DuBois
wrote

> >>>SELECT * FROM users WHERE BINARY dbname = "brain"
> >>>
> >>>perhaps?
> >>

would locate records with "brain".  

> >>How would that locate records with "Brain"? Doesn't sound like a
> >>solution to me...

Similarly,

  SELECT * FROM users WHERE BINARY dbname = "Brain"

would locate records with "Brain".

> >
> >It wouldn't locate such records.  BINARY makes the comparison case
> >sensitive.
> >
> >WHERE dbname = "brain"     returns only "brain" records
> >WHERE dbname = "Brain"     returns only "Brain" records

Paul was probably in a hurry here.  We need "BINARY" between "WHERE" and
"dbname".

> 
> But the original report (which I quoted, and still quote) was that the
> latter (the intended effect) did not work as it returned also "brain".
> Your solution is apparently no solution to this problem.

> 
> So the question remains what the solution (or the cause of the
> problem!) is.
> 
> --
> (database,sql,query,table) GRRR!!!
> 
> Marjolein Katsma      [EMAIL PROTECTED]
> Java Woman - http://javawoman.com/
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

Michael Stassen
University Information Technology Services
Indiana University Bloomington
[EMAIL PROTECTED]



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to