Re: Why VARCHAR TO CHAR automatically when the length less than 4.
I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html In addition to that - it doesn't really matter as the CHAR datatype isn't properly implemented in MySQL and behaves the same as the VARCHAR datatype. I don't believe that is correct. We recently had a very large disk space problem that was solved when we discovered that a column that should have been varchar was instead char, and was taking up excess storage because of it (which a datatype acting like varchar wouldn't do). It should be noted that I wasn't talking about physical storage but about the logical datatype. How things are stored on disk is totally independant from the logical datatype - you can do whatever you like with it. With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL MS SQL Server. Upscene Productions http://www.upscene.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Why VARCHAR TO CHAR automatically when the length less than 4.
Emi Lu [EMAIL PROTECTED] wrote: I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Why VARCHAR TO CHAR automatically when the length less than 4.
I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html In addition to that - it doesn't really matter as the CHAR datatype isn't properly implemented in MySQL and behaves the same as the VARCHAR datatype. With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL MS SQL Server. Upscene Productions http://www.upscene.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Why VARCHAR TO CHAR automatically when the length less than 4.
On Mon, 23 Aug 2004 15:25:21 +0200, Martijn Tonies [EMAIL PROTECTED] wrote: I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html In addition to that - it doesn't really matter as the CHAR datatype isn't properly implemented in MySQL and behaves the same as the VARCHAR datatype. I don't believe that is correct. We recently had a very large disk space problem that was solved when we discovered that a column that should have been varchar was instead char, and was taking up excess storage because of it (which a datatype acting like varchar wouldn't do). -- Joe -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Why VARCHAR TO CHAR automatically when the length less than 4.
Hello all, I have a questions about varchar columns change to CHAR columns automatically. When I designed a table t1 create table t1(id varchar(3) not null) in MySQL. After that, we use desc t1 to see the description of table t1. The result is the following: === +---+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-+---+ | id| char(3) | YES | | NULL| | +---+-+--+-+-+---+ I did not understand why the varchar(3) is changed to char(3) automatically. While if we define a varchar(4) it will not change to char(4) automatically. Could somebody help and explain that please? Thanks a lot! Emi Lu -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]