List:General Discussion« Previous MessageNext Message »
From:Egor Egorov Date:July 8 2003 8:30am
Subject:Re: concat() differences between mssql and mysql
View as plain text  
"Ooks Server" <OoksServer@stripped> wrote:
> I've run into a problem with the behavior of concat(). If I have two fields,
> char(10), and I do this:
> 
> concat(field1,fields)
> 
> With MSSQL I get both fields including trailing spaces. With MYSql, I get
> the two fields with the trailing spaces trimmed. Example:
> 
> Field1 = "abc       "
> Field2 = "qwerty    "
> 
> MSSQL -> concat( field1, fields) -> "abc       qwerty    "
> MYSQL -> concat( field1, fields) -> "abcqwerty"
> 
> How do I get Mysql to behave like MSSQL does? I need it to concatenate the
> fields without stripping the trailing spaces.

It's a known behaviour of MySQL. MySQL removes trailing spaces at the end of VARCHAR and
CHAR columns:
	http://www.mysql.com/doc/en/Open_bugs.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   Egor.Egorov@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
Trouble creating usersMichael Iatauro8 Jul
  • concat() differences between mssql and mysqlOoks Server8 Jul
    • Re: concat() differences between mssql and mysqlEgor Egorov8 Jul
      • RE: concat() differences between mssql and mysqlAndy Eastham8 Jul
    • RE: concat() differences between mssql and mysqlDaevid Vincent8 Jul
      • RE: concat() differences between mssql and mysqlPaul DuBois9 Jul
  • Re: Trouble creating usersNils Valentin8 Jul
  • Re: Trouble creating usersMichael Iatauro8 Jul
    • Re: Trouble creating usersNils Valentin8 Jul
  • Re: Trouble creating usersMichael Iatauro8 Jul
    • Re: Trouble creating usersNils Valentin9 Jul
    • Re: Trouble creating usersPaul DuBois9 Jul