List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:January 10 2004 6:14pm
Subject:Re: Automatic conversion from `char` TO `varchar`
View as plain text  
The manual <http://www.mysql.com/doc/en/Open_bugs.html> says

> The following problems are known and will be fixed in due time:
> [...]
> 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 SQL-92. The bug is that in
> MySQL Server, VARCHAR columns are treated the same way.

That seems the reverse of what you are saying.

Michael

Martijn Tonies wrote:

> Hi,
> 
> 
>>No, it´s not strange.
>>Look the manual at http://www.mysql.com/doc/en/Silent_column_changes.html
> 
> 
> Yes, it's documented. But it still is strange.
> 
> CHAR should, according to the SQL specification, pad any value
> smaller than the defined number of characters with spaces when
> it returns the value to the client. VARCHAR doesn't.
> 
> So yes, it's strange. But you just have to live with it. I guess.
> 
> With regards,
> 
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
> Server.
> Upscene Productions
> http://www.upscene.com
> 
> 
> 
>>Best Regards
>>---
>>Luciano Barcaro
>>Depto. Informática - Laboratório Alvaro
>>
>>Hassan Shaikh wrote:
>>
>>
>>>Hi,
>>>
>>>It's really strange but when I execute the following statement, all my
> 
> char(10) columns turn into varchar(10). My other tables are ok and I've
> tried create dummy table also. Problem seems to be associated with this
> table only.
> 
> 
> 

Thread
Automatic conversion from `char` TO `varchar`Hassan Shaikh10 Jan
  • Re: Automatic conversion from `char` TO `varchar`Luciano Barcaro10 Jan
  • Re: Automatic conversion from `char` TO `varchar`Fred van Engen10 Jan
  • Re: Automatic conversion from `char` TO `varchar`Martijn Tonies10 Jan
    • Re: Automatic conversion from `char` TO `varchar`Michael Stassen10 Jan
  • Re: Automatic conversion from `char` TO `varchar`Martijn Tonies10 Jan
    • Re: Automatic conversion from `char` TO `varchar`Michael Stassen12 Jan
  • Re: Automatic conversion from `char` TO `varchar`Martijn Tonies12 Jan
    • Re: Automatic conversion from `char` TO `varchar`Michael Stassen12 Jan
  • Re: Automatic conversion from `char` TO `varchar`Matt W12 Jan
  • Re: Automatic conversion from `char` TO `varchar`Martijn Tonies12 Jan
  • Re: Automatic conversion from `char` TO `varchar`Bernard Kenik12 Jan