David,
Friday, March 08, 2002, 11:03:30 PM, you wrote:

DMP> I just tried something and would a second opinion:

DMP> I re-configured my MySQL server on my RH Linux machine using the following :

DMP> CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS ./configure

DMP> and ran the following SQL:

DMP> CREATE TABLE FOO (foo int NOT NULL DEFAULT 5, foo1 INT NULL);

DMP> INSERT INTO FOO (foo1) VALUES (1);

DMP> MySQL-Error:
DMP> ======================
DMP> 1048 - Column 'foo' cannot be null.

DMP> So is it true that you either have an installation of MySQL that will have
DMP> defaults for NOT NULL defined columns (explicity or implied) or you can have
DMP> an installation that does not allow default values for NOT NULL defined
DMP> columns?

Yes, if you specify CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS ./configure
you will have errors in INSERT statements for NOT NULL columns
inserting NULL values.

DMP> What I want is to be able to create a table that has columns defined as NOT
DMP> NULL and if I don't assign a default to that column, I want an error if I
DMP> don't give it a value on insert.  What I DON'T want is to define a column as
DMP> NOT NULL with NO EXPLICIT DEFAULT to get a value if it is left out of an
DMP> insert statements list of column/value set.
DMP> Does this make sense??

Looks like it does but try to be more clear.


-- 
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

Reply via email to