[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MySQL] can you have a no-default column; error if unspecified?
Bennett Haselton wrote:
NOT NULL doesn't mean that the column doesn't have a default, it just
means that the default is not null.
In other, more conventional (:-)), databases, NOT NULL means simply "NOT
NULL", and implies nothing about defaults - that's a MySQL-ism. (Thus, a
NOT NULL column with no default should give an error if you insert without
specifying a value for that column, since the "default DEFAULT" should be
NULL).
It's possible to compile MySQL with a special *compile-time* flag (see the
flag -DDONT_USE_DEFAULT_FIELDS in http://www.mysql.com/doc/B/u/Bugs.html
and http://www.mysql.com/doc/c/o/configure_options.html).
And I'm glad to see that this behavior is listed as a bug rather than as a
feature :-), which gives me hope that someday it will be tackled (to at
least make it a run-time configurable option rather than a compile-time
forced option).
--
Shankar.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <mysql-thread92917@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.