Bug #42481 MyISAM adds two useless? 0x00 bytes to float in record
Submitted: 30 Jan 2009 14:33 Modified: 2 Feb 2009 17:24
Reporter: Oli Sennhauser Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.1.30, 5.0, 5.1, 6.0 bzr OS:Any
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D3 (Medium)

[30 Jan 2009 14:33] Oli Sennhauser
Description:
When creating a table with one float column only the row size is 7 instead of 5 bytes.

How to repeat:
CREATE TABLE t2 (f1 float ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t2 values(1.0);
insert into t2 select f1 from t2;
...
optimize table t2;
show table status;

+------+--------+------------+---------+----------------+-------------+
| Name | Engine | Row_format | Rows    | Avg_row_length | Data_length |
+------+--------+------------+---------+----------------+-------------+
| t2   | MyISAM | Fixed      | 1000000 |              7 |     7000000 |
+------+--------+------------+---------+----------------+-------------+

hexdump looks like this:

float : fd 99 99 29 41 00 00 fd ...

Suggested fix:
no idea.
[2 Feb 2009 8:16] Sveta Smirnova
Thank you for the report.

Verified as described since version 5.0.

Probably documentation should be updated. For example here: http://dev.mysql.com/doc/refman/5.1/en/storage-requirements.html and here: http://forge.mysql.com/wiki/MySQL_Internals_MyISAM#MyISAM_Record_Structure
[2 Feb 2009 17:24] Sinisa Milivojevic
This is not a bug as there is a minimum length of the records for the fixed-length records of MyISAM table. Minimum length is necessary in order to accommodate 6 bytes that are needed for data pointers for the chain of deleted records. This chain has to be maintained in the data file whenever records are deleted from the table.