Mysql Unique Index with Null Values

Wherever possible I try to avoid null values in fields but it was necessary to use one on a table where I wanted a unique index and a blank value. At first I did not think this was possible but some research provided that a unique index on a null-able field is perfectly valid.

See the MySQL reference (version 5.5).

A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row. For all engines, a UNIQUE index allows multiple NULL values for columns that can contain NULL.