David, Thursday, March 14, 2002, 9:30:24 PM, you wrote: DMP> ok, more specific: DMP> here is a table: DMP> CREATE TABLE FOO (foo1 int NOT NULL, foo2 int NOT NULL Default 1)
DMP> If I do an insert into the FOO table with the following: DMP> INSERT INTO FOO (foo1,foo2) VALUES (1,1) DMP> Everything works as planned. DMP> If I do an insert into the FOO table with the following: DMP> INSERT INTO FOO (foo1) VALUES (1) DMP> Everything works as planned DMP> If I do an insert into the FOO table with the following: DMP> INSERT INTO FOO (foo2) VALUES (1) DMP> I want an error. But what happens is that the db engine explicitly defines DMP> a default of 0 to the foo1 column even though I defined it as int NOT NULL DMP> and did not give it a default. DMP> After I change the configuration with the following: DMP> CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS ./configure DMP> and re-create my table in a new database, I do get an error on DMP> INSERT INTO FOO (foo2) VALUES (1) DMP> because I didn't give a value for foo1, but I also get an error on this: DMP> INSERT INTO FOO (foo1) VALUES (1) DMP> even though I have explicitly defined a default for foo2. DMP> So..... What I want: DMP> No default unless I define one DMP> Error on NOT NULL if I don't define a default DMP> Default inserted if NOT NULL and I define a default and I don't specify a DMP> value in an insert statement DMP> Does this make more sense? Unfortunatly, MySQL doesn't support it now, but this feature is in our future plans. Look at: http://www.mysql.com/doc/T/O/TODO_future.html DMP> David -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com --------------------------------------------------------------------- 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 <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php