List:General Discussion« Previous MessageNext Message »
From:Krishna Chandra Prajapati Date:September 10 2008 4:51am
Subject:Re: DATATYPES
View as plain text  
Hi,

How prior version 5.0.19 stores varchar(1000).

mysql> create table ts (name varchar(1000));
Query OK, 0 rows affected (0.09 sec)

mysql> show create table ts;
+-------+------------------------------------------------------------------------------------------------+
| Table | Create
Table
|
+-------+------------------------------------------------------------------------------------------------+
| ts    | CREATE TABLE `ts` (
  `name` varchar(1000) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------------------------------------+
1 row in set (0.05 sec)

mysql> select version();
+------------+
| version()  |
+------------+
| 5.0.19-log |
+------------+
1 row in set (0.00 sec)

mysql> insert into ts
values('gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg');
Query OK, 1 row affected (0.00 sec)

mysql> select * from ts;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
name
|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>

mysql> select length(name) from ts;
+--------------+
| length(name) |
+--------------+
| 992          |
+--------------+
1 row in set (0.01 sec)


On Tue, Sep 9, 2008 at 7:28 PM, Terry Riley <moscow@stripped> wrote:

> Have you checked the manual to be sure that the 65000 varchar is
> available to the version of MySQL you are using? Prior to 5.0.3, it was
> 255 only.
>
> ----- Original Message -----
>
> > *From:* "Krishna Chandra Prajapati" <prajapatikc@stripped>
> > *To:* mysql <mysql@stripped>
> > *Date:* Tue, 9 Sep 2008 17:54:46 +0530
> >
> > Hi,
> >
> > I would like to know the difference between char, varchar and text.
> >
> > char limit 255 character fixed length
> > varchar limit 65,000 character variable length
> > text limit 65,000 character variable length.
> >
> > --
> > Krishna Chandra Prajapati
> >
> >
> >
> > ---
> > avast! Antivirus: Inbound message clean.
> > Virus Database (VPS): 080908-0, 08/09/2008
> > Tested on: 09/09/2008 13:40:08
> > avast! - copyright (c) 1988-2008 ALWIL Software.
> > http://www.avast.com
> >
> >
> >
>
>
> Terry
> http://www.confexdb.co.uk/
>
>
> ---
> avast! Antivirus: Outbound message clean.
> Virus Database (VPS): 080908-0, 08/09/2008
> Tested on: 09/09/2008 14:58:55
> avast! - copyright (c) 1988-2008 ALWIL Software.
> http://www.avast.com
>
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>


-- 
Krishna Chandra Prajapati

Thread
DATATYPESKrishna Chandra Prajapati9 Sep
  • Re: DATATYPESTerry Riley9 Sep
  • Re: DATATYPESBrent Baisley9 Sep
    • Re: DATATYPESKrishna Chandra Prajapati9 Sep
  • Re: DATATYPESTerry Riley9 Sep
    • Re: DATATYPESKrishna Chandra Prajapati10 Sep
  • Re: DATATYPESMartijn Tonies9 Sep
    • Re: DATATYPESKrishna Chandra Prajapati10 Sep