List:General Discussion« Previous MessageNext Message »
From:Jocelyn Fournier Date:June 28 2002 8:57pm
Subject:Re: Create Table Bug w/Varchar and Char
View as plain text  
Hi,

Take a look here :

http://www.mysql.com/doc/S/i/Silent_column_changes.html

"VARCHAR columns with a length less than four are changed to CHAR. "

Regards,
  Jocelyn Fournier

----- Original Message -----
From: "Mikhail Entaltsev" <mike_lynx@stripped>
To: "Don Vu" <dvu@stripped>; "MySQL Mailing List (E-mail)"
<mysql@stripped>
Sent: Friday, June 28, 2002 10:12 PM
Subject: Re: Create Table Bug w/Varchar and Char


> Don,
>
> check http://www.mysql.com/doc/S/i/Silent_column_changes.html
>
> Mikhail.
>
> ----- Original Message -----
> From: "Don Vu" <dvu@stripped>
> To: "MySQL Mailing List (E-mail)" <mysql@stripped>
> Sent: Friday, June 28, 2002 20:00
> Subject: Create Table Bug w/Varchar and Char
>
>
> I'm seeing some freaky behavior from MySQL. Seems as if the column type in
> my CREATE TABLE script isn't being created...i.e. some of the VARCHARs
> become CHARs?!?!
>
> fyi...i'm running MySQL 3.23.37 on Red Hat Linux...
>
> When I try to do this Create Table script:
>
> Create table MemberSummary2 (
>         memberId Varchar(20) NOT NULL ,
>         firstName Varchar(50) ,
>         lastName Varchar(50) ,
>         gender Varchar(1) ,
>         email Varchar(50) ,
>         homePhone Varchar(20) ,
>         address1 Varchar(50) ,
>         address2 Varchar(50) ,
>         city Varchar(20) ,
>         state Varchar(2) ,
>         zip Varchar(5) ,
>         ageGroup Varchar(20) ,
>         birthday Date NULL,
>         moviePref Varchar(50),
>         2ndFirstName Varchar(50) ,
>         2ndLastName Varchar(50) ,
>         2ndGender Varchar(1) ,
>         2ndBirthday Date NULL,
>         planTypeId Integer(11) ,
>         purchaseDate Date NULL,
>         purchaseAmt Float(4,2) ,
>         charterFlag Varchar(1) ,
>         paymentType Varchar(20) ,
>         giftRecd Varchar(1) ,
>         tempCard Varchar(1) ,
>         inputInit Varchar(3) ,
>         http_date Varchar(20),
>         http_time Time ,
>         sentEmail Varchar(1) ,
>  Primary Key (memberId)
> );
>
> I get this:
>
> mysql> source test.sql
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> desc MemberSummary2;
> +--------------+-------------+------+-----+---------+-------+
> | Field        | Type        | Null | Key | Default | Extra |
> +--------------+-------------+------+-----+---------+-------+
> | memberId     | varchar(20) |      | PRI |         |       |
> | firstName    | varchar(50) | YES  |     | NULL    |       |
> | lastName     | varchar(50) | YES  |     | NULL    |       |
> | gender       | char(1)     | YES  |     | NULL    |       |
> | email        | varchar(50) | YES  |     | NULL    |       |
> | homePhone    | varchar(20) | YES  |     | NULL    |       |
> | address1     | varchar(50) | YES  |     | NULL    |       |
> | address2     | varchar(50) | YES  |     | NULL    |       |
> | city         | varchar(20) | YES  |     | NULL    |       |
> | state        | char(2)     | YES  |     | NULL    |       |
> | zip          | varchar(5)  | YES  |     | NULL    |       |
> | ageGroup     | varchar(20) | YES  |     | NULL    |       |
> | birthday     | date        | YES  |     | NULL    |       |
> | moviePref    | varchar(50) | YES  |     | NULL    |       |
> | 2ndFirstName | varchar(50) | YES  |     | NULL    |       |
> | 2ndLastName  | varchar(50) | YES  |     | NULL    |       |
> | 2ndGender    | char(1)     | YES  |     | NULL    |       |
> | 2ndBirthday  | date        | YES  |     | NULL    |       |
> | planTypeId   | int(11)     | YES  |     | NULL    |       |
> | purchaseDate | date        | YES  |     | NULL    |       |
> | purchaseAmt  | float(4,2)  | YES  |     | NULL    |       |
> | charterFlag  | char(1)     | YES  |     | NULL    |       |
> | paymentType  | varchar(20) | YES  |     | NULL    |       |
> | giftRecd     | char(1)     | YES  |     | NULL    |       |
> | tempCard     | char(1)     | YES  |     | NULL    |       |
> | inputInit    | char(3)     | YES  |     | NULL    |       |
> | http_date    | varchar(20) | YES  |     | NULL    |       |
> | http_time    | time        | YES  |     | NULL    |       |
> | sentEmail    | char(1)     | YES  |     | NULL    |       |
> +--------------+-------------+------+-----+---------+-------+
> 29 rows in set (0.00 sec)
>
> How does the Gender, State, etc. go from Varchar to Char?
>
> any insight appreciated...
>
> -Don
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <mysql-thread113342@stripped>
> To unsubscribe, e-mail
<mysql-unsubscribe-mike_lynx=smtp.ru@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <mysql-thread113355@stripped>
> To unsubscribe, e-mail
<mysql-unsubscribe-joc=presence-pc.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
>

Thread
Create Table Bug w/Varchar and CharDon Vu28 Jun
  • Re: Create Table Bug w/Varchar and CharDavid Felio28 Jun
  • Re: Create Table Bug w/Varchar and CharMikhail Entaltsev28 Jun
  • Re: Create Table Bug w/Varchar and CharJocelyn Fournier28 Jun
RE: Create Table Bug w/Varchar and CharDon Vu28 Jun
  • RE: Create Table Bug w/Varchar and CharKeith C. Ivey28 Jun