Monday, February 16, 2009

MySQL Default Strings

MySQL 5.0.22 ignores DEFAULT definitions with blank strings. In fact it treats them as NULL:
ALTER TABLE Widgets DEFAULT ''

desc widgets;
+-----------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+--------------+------+-----+---------+----------------+
| form_data | text | YES | | NULL | |

That sucks, but it was interesting.

No comments: