List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:September 11 2006 6:18pm
Subject:RE: Varchar mystery
View as plain text  
You are absolutely right. The entire data base is UTF-8.

That explains why the examples I found were not in English.

Thanks.


Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

-----Original Message-----
From: Paul DuBois [mailto:paul@stripped]
Sent: Monday, September 11, 2006 2:09 PM
To: Jerry Schwartz
Cc: mysql@stripped
Subject: Re: Varchar mystery

Jerry Schwartz wrote:
> I'm using MySQL Linux version 4.1.21 standard.
>
> I have a table with fields of a variety of types, including varchar(255)
and
> text (which might matter). When I do
>
> SELECT MAX(LENGTH(x)) FROM tx;
>
> where x is a varchar(255), I get back 266 as the result of the query!
>
> This isn't listed as one of the silent conversions - varchar(256) would be
> converted to text, but not varchar(255). What's going on?

Perhaps you are using multi-byte characters?  LENGTH() returns a length
in bytes. CHAR_LENGTH() returns the length in characters.




Thread
Varchar mysteryJerry Schwartz11 Sep
  • Re: Varchar mysteryPaul DuBois11 Sep
    • RE: Varchar mysteryJerry Schwartz11 Sep
  • Re: Varchar mysteryMartijn Tonies11 Sep