List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:February 21 2003 3:08am
Subject:Re: Is this a bug?
View as plain text  
In the last episode (Feb 21), Zhestkov Victor said:
> I have a table with varchar column and when I execute SELECT query like that:
> SELECT * FROM sometable WHERE somecolumn='abc   '; it returns records which 
> contain records with bo 'abc  ' value, and which are only 'abc'.
> Thry this SELECT 'abc' = 'abc   '; it returns true. I think it rather strange.
> I have mysql installed from Debian 3.0 r0.

From the docs:

   * All string columns, except `BLOB' and `TEXT' columns, automatically
     have all trailing spaces removed when retrieved. For `CHAR' types
     this is okay, and may be regarded as a feature according to ANSI
     SQL92. The bug is that in MySQL Server, `VARCHAR' columns are
     treated the same way.

It's mentioned in 3 other places as well.

	Dan Nelson
Is this a bug?Zhestkov Victor21 Feb
  • Re: Is this a bug?Dan Nelson21 Feb
    • Re: Is this a bug?KH Chiu21 Feb