Path: news.netfront.net!paganini.linuxd.org!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From: Lennart Jonsson <erik.lennart.jonsson@gmail.com>
Newsgroups: comp.databases.mysql
Subject: Re: mysql lenght() and char_length not working for longer texts
Date: Tue, 7 Jul 2015 08:30:54 +0200
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <mnfrk9$k3f$1@dont-email.me>
References: <6dd880fe-c726-4913-b05e-d06bc0e42d4c@googlegroups.com>
 <mn3qj0$fse$1@dont-email.me>
 <varchar-length-20150705231630@ram.dialup.fu-berlin.de>
 <mnes4u$u7l$1@dont-email.me> <MySQL-20150707001048@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 7 Jul 2015 06:29:29 +0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="7e2da11d2f2fa04799963f04fc962890";
 logging-data="20591"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19mgo2pLBWZyRS7wcZzb15A"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.0.1
In-Reply-To: <MySQL-20150707001048@ram.dialup.fu-berlin.de>
Cancel-Lock: sha1:RejeVcZ2c2IFbIr/1WiCzCvc7nU=
Xref: news.netfront.net comp.databases.mysql:2456

On 07/07/2015 12:12 AM, Stefan Ram wrote:
[...]
>
> mysql> CREATE TABLE T ( N VARCHAR( 65533 ) NOT NULL )
>      -> ENGINE = MyISAM CHARACTER SET latin1;
> Query OK, 0 rows affected (0.00 sec)
>
>

Your missing my point, or perhaps I'm missing yours. I never claimed 
that it is not possible to create a table like that. The OP wants a way 
to restrict the maximum length of a column of type text to 32766 
characters. My suggestion was to use a varchar(32766) instead of text. 
Can you explain how a varchar(65533) column can solve the OP's problem?


/Lennart

