List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:November 27 2002 10:16pm
Subject:Re: this is WEAK!
View as plain text  
Ach.  I was misreading the original message the entire time.

The reason you see the behavior below for the second query is that
the comparisons are done without regard for trailing spaces.

If you change the column type to TEXT, the second query will
return nothing.  (On the other hand, another effect is that values
stored in the column will *not* have trailing spaces stripped.)


At 15:06 -0600 11/27/02, johnt@stripped wrote:
>member varchar(16) NOT NULL default '',
>PRIMARY KEY  (member),
>
>
>On Wed, Nov 27, 2002 at 03:28:15PM -0600, Paul DuBois wrote:
>>  At 14:48 -0600 11/27/02, johnt@stripped wrote:
>>  >Why? (Note the extra space after "me" in the second select)
>>
>>  Hardly enough information to go on.  Apparently you're using a
>>  column type like BLOB or TEXT for which trailing spaces are not
>>  removed?
>>
>>  >
>>  >Your MySQL connection id is 6021 to server version: 3.23.41-log
>>  >
>>  >mysql> select contact from options where member='me';
>>  >+---------+
>>  >| contact |
>>  >+---------+
>>  >| me      |
>>  >+---------+
>>  >1 row in set (0.00 sec)
>>  >
>>  >mysql> select contact from options where member='me ';
>>  >+---------+
>>  >| contact |
>>  >+---------+
>>  >| me      |
>>  >+---------+
>>  >1 row in set (0.00 sec)

Thread
this is WEAK!johnt27 Nov
  • Re: this is WEAK!Paul DuBois27 Nov
    • Re: this is WEAK!johnt27 Nov
      • Re: this is WEAK!Paul DuBois27 Nov
        • Re: this is WEAK!johnt27 Nov
      • Re: this is WEAK!Paul DuBois27 Nov
  • Re: this is WEAK!Dan Nelson27 Nov
    • Re: this is WEAK!johnt27 Nov
  • Re: this is WEAK!Chris Knipe27 Nov