At 8:09 PM -0700 8/29/04, Jonathan Leffler wrote:Darren Duncan wrote:At 6:53 PM -0400 8/29/04, Paul G. Weiss wrote:Why break a perfectly sensible system?Even so, it is on the MySQL to-do list that such non-standard behaviour is going to be changed. Hopefully sooner rather than later. -- DarrenMySQL works just as you describe. -P
I'll quote some sections from the MySQL TODO, to illustrate what I'm saying. Pay particular attention to:
* Don't add automatic DEFAULT values to columns. Produce an error for any INSERT statement that is missing a value for a column that has no DEFAULT .
My read of this statement does not rule out the current behavior of allowing default values for nullable columns. Instead it would prevent:
create table foo (a varchar null, bar integer not null)
from silently becoming
create table foo (a varchar null, bar integer not null default 0)
as it does now, and so
insert into foo (a) values ("x")
would be considered an error, rather than an insert of ("x",0) as it is now.