From: Dan Nelson Date: July 10 2002 3:33am Subject: Re: Char type changes to Varchar type List-Archive: http://lists.mysql.com/mysql/114154 Message-Id: <20020710033355.GE8625@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Jul 09), Michael Ivanyo said: > I am using MySql with InnoDB and have just discovered that tables > created using char types show up as varchars when I type, describe > tableName. Previously, I was using MyIsam tables and did not see > char types being changed to varchars so I am a bit puzzled. > > This is true for almost all of the tables I've created, only a couple > of tables retained the char type as specified in my create table > script. > > Is this documented behavior? I haven't been using MySql very long > and haven't seen it mentioned anywhere. http://www.mysql.com/doc/S/i/Silent_column_changes.html * 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 doesn't affect how you use the columns in any way; in MySQL, VARCHAR is just a different way to store characters. MySQL performs this conversion because it saves space and makes table operations faster. See section 7 MySQL Table Types. -- Dan Nelson dnelson@stripped