List:General Discussion« Previous MessageNext Message »
From:Devraj Bhanot Date:May 29 1999 8:47am
Subject:RE: char to varchar
View as plain text  
Further to what Piet has written if you carefully study article 7.6.1
(http://www.php.net/Manual//manual_toc.html#Silent_column_changes
exactly opposite is mentioned.

1. VARCHAR columns with a length less than four are changed to CHAR. 
2. If any column in a table has a variable length, the entire row is
variable-length as a result. Therefore, if a table contains any
variable-length columns (VARCHAR, TEXT or BLOB), all CHAR columns longer
than three characters are changed to VARCHAR columns.  
This clearly states that All Varchars less than 4 Character are
converted from "Varchar to Char".
In point 2 it says that IF ANY OF THE COLUMN IN A ROW IS VarChar THEN
ALL Char ABOVE 3 ARE CONVERTED TO VarChar.

Regards,
Devraj

> -----Original Message-----
> From:	Piet Wesselman [SMTP:pwessel@stripped]
> Sent:	Thursday, May 27, 1999 4:01 PM
> To:	mysql@stripped
> Subject:	Re: char to varchar
> 
> Not quite true. The key sentence in section 7.6.1 is:
> 
> "If any column in a table has a variable length, the entire row is
> variable-length as a result."
> So, to the first David: apparently you also have defined a blob, text
> or varchar column.
> 
> Piet Wesselman
> 
> 
> At 10:27 AM 5/28/99 +0100, you wrote:
> >I'm afraid it's a case of RTFM!
> >
> >Look at section 7.6.1 (Silent column specification changes) which
> says
> >why MySQL changes all CHAR columns of more than 3 characters are
> changed
> >to VARCHAR.
> >
> >David
> >
> >----- Original Message -----
> >From: David Wall <>
> >To: <mysql@stripped>
> >Sent: 28 May 1999 07:26
> >Subject: char to varchar
> >
> >
> >> We have a table that we create using char(30), char(30), char(5),
> >> char(4),char(10),char(10), all with a NOT NULL, but 'show columns
> >from...'
> >> shows those columns all as varchars.  We do have other char tables
> >that
> >> don't become varchars.  There are two INTs and a TIMESTAMP just
> before
> >the
> >> chars that become varchars.
> >>
> >> Anybody know what's going on?
> >>
> >>
> >> David
> >> d.wall@stripped
> >>
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"
> >before
> >> posting. To request this thread, e-mail
> >mysql-thread4068@stripped
> >>
> >> To unsubscribe, send a message to the address shown in the
> >> List-Unsubscribe header of this message. If you cannot see it,
> >> e-mail mysql-unsubscribe@stripped instead.
> >>
> >
> >
> >---------------------------------------------------------------------
> >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"
> before
> >posting. To request this thread, e-mail
> mysql-thread4071@stripped
> >
> >To unsubscribe, send a message to the address shown in the
> >List-Unsubscribe header of this message. If you cannot see it,
> >e-mail mysql-unsubscribe@stripped instead.
> >
> >
> >
Thread
char to varcharDavid Wall28 May
  • Re: char to varcharDavid Viner28 May
  • Re: char to varcharDavid Wall28 May
Re: char to varcharPiet Wesselman28 May
RE: char to varcharDevraj Bhanot29 May