Cal Evans wrote:


I humbly submit an apology. You are correct. This is a bug (No it is NOT a feature)

While you may not like it, this definitely is a feature (or an intentional design decision, at least), not a bug. See the docs at <http://www.mysql.com/doc/en/constraint_NOT_NULL.html>. The first line is, "To be able to support easy handling of non-transactional tables, all fields in MySQL have default values." So, if you don't set a default for a column, mysql chooses one for you. With a few exceptions, NULLable columns default to NULL, NOT NULL columns default to 0 (zero) or '' (empty string). You can change this behavior by building your own mysql from source with the -DDONT_USE_DEFAULT_FIELDS compile option.


you should be able to define a field as NOT NULL without a default or at the very least, define the default as NULL.

This does not make sense to me. Allowing NULL as the default for a column declared NOT NULL would defeat the purpose of declaring it NOT NULL in the first place.


Michael


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to