2 ms·
Type "show warnings" to see them. I really don't understand why people have such a problem with this (and boy oh boy am I loosing a lot of karma for this opini
by ars 16y ago
Type "show warnings" to see them.
I really don't understand why people have such a problem with this (and boy oh boy am I loosing a lot of karma for this opinion).
It's not like it forces this on you. First you can turn it off, and second it only happens if you leave out the columns from the insert, don't leave out the columns and you have nothing to worry about.
I personally find it quite useful. I set column defaults as needed for real data, but when testing I let MySQL put in empty values - it saves having to type each and every column that I don't care about.
- gfodor 16y agoWhen you add "NOT NULL" to a schema, you should be thinking: "make sure the user specifies a value for this column" not "this column should be defaulted to zero." This is insane. If you want to specify a default, well, specify a default.