Description:
UNIX Command Line Client (see above)
Table created with char and int fields (nulls allowed)
Row inserted without any reference for char or int field
Subsequent SELECT statement does NOT reflect a NULL value for char field ONLY
MySQL Query Browser (GUI interface) shows content to be NULL
Numeric fields behave differently: for them, the SELECT statement shows NULL for null values.
How to repeat:
CREATE TABLE `trial` (
`name1` char(20) default NULL,
`name2` char(100) default NULL,
`number1` tinyint(4) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into trial set name2='other stuff';
mysql> select * from trial;
+-------+-------------+---------+
| name1 | name2 | number1 |
+-------+-------------+---------+
| | other stuff | NULL |
+-------+-------------+---------+
1 row in set (0.00 sec)
Suggested fix:
SELECT should render consistent results for char and int fields when encountering NULL.
Expected display from example (above):
mysql> select * from trial;
+-------+-------------+---------+
| name1 | name2 | number1 |
+-------+-------------+---------+
| NULL | other stuff | NULL |
+-------+-------------+---------+
1 row in set (0.00 sec)