MySQL Forums
Forum List  »  Newbie

Column is NOT NULL, no DEFAULT specified - server invents his own default values ?!
Posted by: Armen Zourabian
Date: November 22, 2004 07:02PM

Hi all!

I am used to the fact that if a column is declared NOT NULL and no DEFAULT directive is given with any value whatsover, still MySQL server does not complain about INSERT INTO table1 () VALUES (); when table is created like the following:

CREATE TABLE table1
(
login CHAR(10) ASCII NOT NULL
)TYPE=InnoDB;

Shouldn't the server complain that a value for 'login' field is missing upon executing INSERT query ? In my case the row is inserted and I have no idea what is actually in the login field.

I also wonder how exactly does MySQL manage NULL declared fields ? When I have such, without DEFAULT value, shouldn't they be NULL by DEFAULT ? DO I have to specify NULL explicitly (DEFAULT NULL) ?

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
Column is NOT NULL, no DEFAULT specified - server invents his own default values ?!
November 22, 2004 07:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.