Bug #7012 Views: shows CHAR column instead of VARCHAR in DESCRIBE
Submitted: 4 Dec 2004 23:40 Modified: 29 Jun 2005 12:30
Reporter: Trudy Pelzer Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-alpha-debug OS:Linux (SuSE 9.1)
Assigned to: Assigned Account CPU Architecture:Any

[4 Dec 2004 23:40] Trudy Pelzer
Description:
If I create a view with a column that is based upon 
a base table column defined as VARCHAR, the 
DESCRIBE statement shows the column defined as 
CHAR. This is incorrect; the data types should 
match exactly. 

How to repeat:
mysql> create table t1 (col1 varchar(10)); 
mysql> create view v1 as select * from t1; 
 
mysql> describe t1; 
+-------+-------------+------+-----+---------+-------+ 
| Field | Type        | Null | Key | Default | Extra | 
+-------+-------------+------+-----+---------+-------+ 
| col1  | varchar(10) | YES  |     | NULL    |       | 
+-------+-------------+------+-----+---------+-------+ 
 
mysql> describe v1; 
+-------+----------+------+-----+---------+-------+ 
| Field | Type     | Null | Key | Default | Extra | 
+-------+----------+------+-----+---------+-------+ 
| col1  | char(10) | YES  |     | NULL    |       | 
+-------+----------+------+-----+---------+-------+ 
-- The column's data type should show as VARCHAR(10), 
just like in the table definition.
[2 Jun 2005 23:23] Peter Gulutzan
Also: if it's a CHAR column, it becomes a VARCHAR column.
Also: if it's a GEOMETRY column, it becomes a LONGTEXT column.
[29 Jun 2005 12:32] Evgeny Potemkin
Duplicate of bug #11335